• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14definitions: []
15tests:
16  - file-name: "fneg.64"
17    isa:
18      title: Floating-point unary
19      description: >
20        Perform specified floating-point operation on accumulator
21      exceptions:
22      - x_none
23
24    commands:
25      - file-name: "op_none"
26        isa:
27          instructions:
28            - sig: fneg.64
29              acc: inout:f64
30              format: [op_none]
31        code-template: |
32            #
33                fldai.64 %s
34                fneg.64
35                fmovi.64 v0, %s
36                fcmpg.64 v0
37        description: Check fneg.64 with various values.
38        tags: ['tsan']
39        cases:
40          - values:
41              - "0.0"
42              - "0.0"
43          - values:
44              - "-1.0"
45              - "1.0"
46          - values:
47              - "1.0"
48              - "-1.0"
49          - values:
50              - "3.14159265358979323846"
51              - "-3.14159265358979323846"
52          - values:
53              - "-4.9e-300"
54              - "+4.9e-300"
55          - values:
56              - "1.7976931348623157e308"
57              - "-1.7976931348623157e308"
58          - values:
59              - "+4.9e-300"
60              - "-4.9e-300"
61          - values:
62              - "-1.7976931348623157e308"
63              - "+1.7976931348623157e308"
64
65      - file-name: "nan"
66        isa:
67          instructions:
68            - sig: fneg.64
69              acc: inout:f64
70              format: [op_none]
71        check-type: check-acc-nan
72        code-template: |
73            #
74                fldai.64 %s
75                fneg.64
76        description: Check fneg.64 with NaN.
77        cases:
78          - values:
79              # NaN
80              - "0x7ff8000000000000"
81          - values:
82              # NaN
83              - "0xFFFFFFFFFFFFFFFF"
84
85      - file-name: "bin_val"
86        isa:
87            instructions:
88              - sig: fneg.64
89                acc: inout:f64
90                format: [op_none]
91        code-template: |
92            #
93                fldai.64 %s
94                fneg.64
95                fmovi.64 v0, %s
96                fcmpg.64 v0
97        description: Check fneg.64 with various values (HEX literals).
98        cases:
99            - values:
100                # -max
101                - "0xffefffffffffffff"
102                # +max
103                - "0x7fefffffffffffff"
104            - values:
105                # +max
106                - "0x7fefffffffffffff"
107                # -max
108                - "0xffefffffffffffff"
109            - values:
110                # -Inf
111                - "0xfff0000000000000"
112                # +Inf
113                - "0x7ff0000000000000"
114            - values:
115                # +Inf
116                - "0x7ff0000000000000"
117                # -Inf
118                - "0xfff0000000000000"
119            - values:
120                # +min
121                - "0x0000000000000001"
122                # -min
123                - "0x8000000000000001"
124            - values:
125                # -min
126                - "0x8000000000000001"
127                # +min
128                - "0x0000000000000001"
129            - values:
130                # -0.0d
131                - "0x8000000000000000"
132                - "0"
133            - values:
134                - "0"
135                # -0.0d
136                - "0x8000000000000000"
137
138      - file-name: "acc_type"
139        isa:
140          instructions:
141            - sig: fneg.64
142              acc: inout:f64
143              format: [op_none]
144          verification:
145            - acc_type
146        runner-options: ['verifier-failure', 'verifier-debug-config']
147        bugid: ["964"]
148        tags: ["verifier"]
149        header-template: []
150        code-template: |
151            .record T {}
152            .record panda.String <external>
153            .record panda.Object <external>
154            #
155            .function i32 main() {
156                %s
157                fneg.64
158        check-type: exit-positive
159        description: Check `fneg.64` with incorrect accumulator type.
160        cases:
161          - values:
162            - ldai 1
163          - values:
164            - ldai.64 1
165          - values:
166            - lda.type T
167          - values:
168            - lda.type T[]
169          - values:
170            - lda.type panda.Object
171          - values:
172            - lda.type panda.String
173          - values:
174            - lda.str "x"
175          - values:
176            - |
177              newobj v0, T
178              lda.obj v0
179          - values:
180            - lda.null
181          - values:
182            - |
183              #
184                  movi v0, 10
185                  newarr v0, v0, i32[]
186                  lda.obj v0
187
188      - file-name: uninitialized_regs
189        bugid: ["2787"]
190        tags: ["verifier"]
191        isa:
192          instructions:
193            - sig: fneg.64
194              acc: inout:f64
195              format: [op_none]
196        description: Check fneg.64 with uninitialized accumulator.
197        runner-options: ['verifier-failure', 'verifier-debug-config']
198        header-template: []
199        code-template: |
200          #
201          .function i32 main() {
202              # acc is undefined
203              fneg.64
204        check-type: exit-positive
205