• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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', 'irtoc_ignore']
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-f64
72        tags: ['irtoc_ignore']
73        code-template: |
74          #
75              fldai.64 %s
76              fneg.64
77        description: Check fneg.64 with NaN.
78        cases:
79          - values:
80              # NaN
81              - '0x7ff8000000000000'
82          - values:
83              # NaN
84              - '0xFFFFFFFFFFFFFFFF'
85
86      - file-name: 'bin_val'
87        isa:
88          instructions:
89            - sig: fneg.64
90              acc: inout:f64
91              format: [op_none]
92        tags: ['irtoc_ignore']
93        code-template: |
94          #
95              fldai.64 %s
96              fneg.64
97              fmovi.64 v0, %s
98              fcmpg.64 v0
99        description: Check fneg.64 with various values (HEX literals).
100        cases:
101          - values:
102              # -max
103              - '0xffefffffffffffff'
104              # +max
105              - '0x7fefffffffffffff'
106          - values:
107              # +max
108              - '0x7fefffffffffffff'
109              # -max
110              - '0xffefffffffffffff'
111          - values:
112              # -Inf
113              - '0xfff0000000000000'
114              # +Inf
115              - '0x7ff0000000000000'
116          - values:
117              # +Inf
118              - '0x7ff0000000000000'
119              # -Inf
120              - '0xfff0000000000000'
121          - values:
122              # +min
123              - '0x0000000000000001'
124              # -min
125              - '0x8000000000000001'
126          - values:
127              # -min
128              - '0x8000000000000001'
129              # +min
130              - '0x0000000000000001'
131          - values:
132              # -0.0d
133              - '0x8000000000000000'
134              - '0'
135          - values:
136              - '0'
137              # -0.0d
138              - '0x8000000000000000'
139
140      - file-name: 'acc_type'
141        isa:
142          verification:
143            - acc_type
144        runner-options: ['verifier-failure', 'verifier-config']
145        bugid: ['964']
146        tags: ['verifier']
147        header-template: []
148        code-template: |
149          .record T {}
150          .record panda.String <external>
151          .record panda.Object <external>
152          #
153          .function i32 main() {
154              %s
155              fneg.64
156        check-type: exit-positive
157        description: Check `fneg.64` with incorrect accumulator type.
158        cases:
159          - values:
160              - ldai 1
161          - values:
162              - fldai 1
163            bugid: ['6094']
164          - values:
165              - ldai.64 1
166          - values:
167              - lda.type T
168          - values:
169              - lda.type T[]
170          - values:
171              - lda.type panda.Object
172          - values:
173              - lda.type panda.String
174          - values:
175              - lda.str "x"
176          - values:
177              - |
178                #
179                    newobj v0, T
180                    lda.obj v0
181          - values:
182              - lda.null
183          - values:
184              - |
185                #
186                    movi v0, 10
187                    newarr v0, v0, i32[]
188                    lda.obj v0
189
190      - file-name: uninitialized_regs
191        bugid: ['2787']
192        tags: ['verifier']
193        isa:
194          instructions:
195            - sig: fneg.64
196              acc: inout:f64
197              format: [op_none]
198        description: Check fneg.64 with uninitialized accumulator.
199        runner-options: ['verifier-failure', 'verifier-config']
200        header-template: []
201        code-template: |
202          #
203          .function i32 main() {
204              # acc is undefined
205              fneg.64
206        check-type: exit-positive
207