• 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: "fmovi.64"
17    isa:
18      title: Move immediate-to-register
19      description: >
20        Move integer immediate into a register. For short formats immediate is sign extended to operand size.
21      exceptions:
22        - x_none
23      verification:
24        - none
25    commands:
26      - file-name: "imm_64_p"
27        isa:
28          instructions:
29            - sig: fmovi.64 v:out:f64, imm:f64
30              acc: none
31              format: [op_v_8_imm_64]
32              properties: [acc_none, float]
33        check-type: no-check
34        code-template: |
35          #
36              fldai.64 %s
37              fmovi.64 v0, %s
38              fcmpg.64 v0
39        description: Check fmovi.64 with various positive values (f64 values, HEX literals).
40        tags: ['tsan', 'irtoc_ignore']
41        cases:
42          - values:
43              - "0.0"
44              - "0.0"
45          - values:
46              - "0.1"
47              - "0.1"
48          - values:
49              - "1.0"
50              - "1"
51          - values:
52              - "12345678.90987654"
53              - "12345678.90987654"
54          - values:
55              - "3.141592653589793"
56              - "3.141592653589793"
57          - values:
58              - "3.1415e3"
59              - "0x40a88b0000000000"
60          - values:
61              - "1.7976931348623157e308"
62              - "0x7fefffffffffffff"
63          - values:
64              - "4.9e-324"
65              - "0x0000000000000001"
66          - values:
67              - "1.7976931348623157e308"
68              - "0x7fefffffffffffff"
69          - values:
70              - "0x1234567890ABCDEF"
71              - "5.626349108908516e-221"
72          - values:
73              - "0"
74              - "0x0000000000000000"
75          - values:
76              - "1"
77              - "0x3ff0000000000000"
78          - values:
79              - "9223372036854775807"
80              - "0x43e0000000000000"
81          - values:
82              - "0.55"
83              - "0x3fe199999999999a"
84
85
86      - file-name: "imm_64_n"
87        isa:
88          instructions:
89            - sig: fmovi.64 v:out:f64, imm:f64
90              acc: none
91              format: [op_v_8_imm_64]
92              properties: [acc_none, float]
93        check-type: no-check
94        tags: ['irtoc_ignore']
95        code-template: |
96          #   test - check binary representation of FP literals
97              fmovi.64 v0, %s
98              fldai.64 %s
99              fcmpg.64 v0
100        description: Check fmovi.64 with various negative values (f64 values, HEX literals).
101        cases:
102          - values:
103              - "-0"
104              - "0x8000000000000000"
105          - values:
106              - "-0x0"
107              - "0x8000000000000000"
108          - values:
109              - "-1"
110              - "0xbff0000000000000"
111          - values:
112              - "-0x1"
113              - "0xbff0000000000000"
114          - values:
115              - "-0x7FFFFFFFFFFFFFFF"
116              - "0xc3e0000000000000"
117          - values:
118              - "-0.0"
119              - "0x8000000000000000"
120          - values:
121              - "-0.1"
122              - "0xbfb999999999999a"
123          - values:
124              - "-1.0"
125              - "0xbff0000000000000"
126          - values:
127              - "-12345678.90987654"
128              - "0xc1678c29dd1db568"
129          - values:
130              - "-3.141592653589793"
131              - "0xc00921fb54442d18"
132          - values:
133              - "-4.9e-324"
134              - "0x8000000000000001"
135          - values:
136              - "-1.7976931348623157e308"
137              - "0xffefffffffffffff"
138          - values:
139              - "-0.55"
140              - "0xbfe199999999999a"
141
142
143      - file-name: "err"
144        isa:
145          instructions:
146            - sig: fmovi.64 v:out:f64, imm:f64
147              acc: none
148              format: [op_v_8_imm_64]
149              properties: [acc_none, float]
150        code-template: |
151          .record panda.Object <external>
152          .function i32 main() {
153              fmovi.64 %s
154        check-type: exit-positive
155        header-template: []
156        runner-options: [compile-failure]
157        description: Check fmovi.64 with various incorrect f64 literals.
158        cases:
159          - values:
160              - ''
161          - values:
162              - a0, 0.1
163          - values:
164              - v0, 1e
165          - values:
166              - v0, -1e
167          - values:
168              - v0, 1e1e1
169          - values:
170              - v0, -1e1e1
171          - values:
172              - v0, "1.0"
173          - values:
174              - v0, panda.Object
175          - values:
176              - v0, 1.1, v2
177          - values:
178              - v256, 1.1
179          - values:
180              - v32767, 0.0
181          - values:
182              - v65535, 0.0
183
184
185      - file-name: "range"
186        isa:
187          instructions:
188            - sig: fmovi.64 v:out:f64, imm:f64
189              acc: none
190              format: [op_v_8_imm_64]
191              properties: [acc_none, float]
192        code-template: |
193          #
194              fmovi.64 v0, %s
195        check-type: exit-positive
196        runner-options: [compile-only]
197        cases:
198          - values:
199              - "+2e-324"
200          - values:
201              - "-2e-324"
202          - values:
203              - "1.8e328"
204            bugid: ["1132"]
205          - values:
206              - "-1.8e328"
207            bugid: ["1132"]
208
209
210      - file-name: "range_val"
211        isa:
212          instructions:
213            - sig: fmovi.64 v:out:f64, imm:f64
214              acc: none
215              format: [op_v_8_imm_64]
216              properties: [acc_none, float]
217        tags: ['irtoc_ignore']
218        code-template: |
219          #   test - check binary representation of FP literals
220              fmovi.64 v0, %s
221              fldai.64 %s
222              fcmpg.64 v0
223        check-type: no-check
224        cases:
225          - values:
226              - "+2e-325"
227              - "0"
228          - values:
229              - "-2e-325"
230              - "-0.0"
231          - values:
232              - "1.8e328"
233              - "0x7ff0000000000000"
234            bugid: ["1132"]
235          - values:
236              - "-1.8e328"
237              - "0xfff0000000000000"
238            bugid: ["1132"]
239
240
241      - file-name: "vd_8"
242        isa:
243          instructions:
244            - sig: fmovi.64 v:out:f64, imm:f64
245              acc: none
246              format: [op_v_8_imm_64]
247              properties: [acc_none, float]
248        tags: ['irtoc_ignore']
249        code-template: |
250          #
251              fldai.64 1
252              fmovi.64 %s, 1
253              fcmpl.64 %s
254        check-type: no-check
255        cases:
256          - values:
257              - v1
258              - v1
259          - values:
260              - v15
261              - v15
262          - values:
263              - v16
264              - v16
265          - values:
266              - v255
267              - v255
268