• 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: fldai
17    isa:
18      title: Load accumulator from immediate
19      description: >
20        Load immediate into accumulator. For short formats immediate is sign extended to operand size.
21      exceptions:
22        - x_none
23      verification:
24        - none
25    commands:
26      - file-name: pos
27        isa:
28          instructions:
29            - sig: fldai imm:f32
30              acc: out:f32
31              prefix: f32
32              format: [pref_op_imm_32]
33        check-type: no-check
34        code-template: |
35          #   test - check binary representation of FP literals - positive
36              fldai %s
37              fmovi v0, %s
38              fcmpg v0
39        description: Check fldai with various positive values (float and HEX literal).
40        tags: ['tsan', 'irtoc_ignore']
41        cases:
42          - values:
43              - '0.0'
44              - '0x0'
45          - values:
46              - '0.1'
47              - '0x3dcccccd'
48          - values:
49              - '1.0'
50              - '0x3f800000'
51          - values:
52              - '12345678.90987654'
53              - '0x4b3c614f'
54          - values:
55              - '3.141592653589793'
56              - '0x40490fdb'
57          - values:
58              - '3.1415e3'
59              - '0x45445800'
60          - values:
61              - '1.7976931e308'
62              - '0x7f800000'
63          - values:
64              - '4.9e-324'
65              - '0x0'
66          - values:
67              - '0x12345678'
68              - '5.6904566e-28'
69          - values:
70              - '9223372036854775807'
71              - '0x5f000000'
72          - values:
73              - '0.55'
74              - '0x3f0ccccd'
75
76      - file-name: neg
77        isa:
78          instructions:
79            - sig: fldai imm:f32
80              acc: out:f32
81              prefix: f32
82              format: [pref_op_imm_32]
83        check-type: no-check
84        tags: ['irtoc_ignore']
85        code-template: |
86          #   test - check binary representation of FP literals - negative
87              fldai %s
88              fmovi v0, %s
89              fcmpg v0
90        description: Check fldai with various negative values (float and HEX literal).
91        cases:
92          - values:
93              - '-0'
94              - '0x80000000'
95          - values:
96              - '-1'
97              - '0xbf800000'
98          - values:
99              - '-0.0'
100              - '0x80000000'
101          - values:
102              - '-0.1'
103              - '0xbdcccccd'
104          - values:
105              - '-1.0'
106              - '0xbf800000'
107          - values:
108              - '-12345678.90987654'
109              - '0xcb3c614f'
110          - values:
111              - '-3.141592653589793'
112              - '0xc0490fdb'
113          - values:
114              - '-1.4012985e-45'
115              - '0x80000001'
116          - values:
117              - '-3.4028235e+38'
118              - '0xff7fffff'
119          - values:
120              - '-0.55'
121              - '0xbf0ccccd'
122
123      - file-name: err
124        isa:
125          instructions:
126            - sig: fldai imm:f32
127              acc: out:f32
128              prefix: f32
129              format: [pref_op_imm_32]
130        code-template: |
131          #
132              fldai %s
133        check-type: none
134        runner-options: [compile-failure]
135        description: Check fldai with incorrect literal.
136        cases:
137          - values:
138              - '1e'
139          - values:
140              - 'e1'
141            ignore: true
142            bugid: ['932']
143          - values:
144              - '-1e'
145          - values:
146              - '-e1'
147            ignore: true
148            bugid: ['932']
149          - values:
150              - '1e1e1'
151          - values:
152              - '-1e1e1'
153
154      - file-name: range
155        isa:
156          instructions:
157            - sig: fldai imm:f32
158              acc: out:f32
159              prefix: f32
160              format: [pref_op_imm_32]
161        check-type: no-check
162        tags: ['irtoc_ignore']
163        code-template: |
164          #   test - check binary representation of FP literals - positive
165              fldai %s
166              fmovi v0, %s
167              fcmpg v0
168        description: Check fldai with out-of-range positive/negative values.
169        cases:
170          - values:
171              - '+1.4e-45'
172              - '0x00000001'
173          - values:
174              - '+1.4e-46'
175              - '0x00000000'
176          - values:
177              - '-1.4e-45'
178              - '0x80000001'
179          - values:
180              - '-1.4e-46'
181              - '0x80000000'
182          - values:
183              - '3.4028235e38'
184              - '0x7f7fffff'
185            bugid: ['966', '965']
186          - values:
187              - '3.4028235e39'
188              - '0x7f800000'
189            bugid: ['966', '965']
190          - values:
191              - '-3.4028235e38'
192              - '0xff7fffff'
193            bugid: ['966', '965']
194          - values:
195              - '-3.4028235e39'
196              - '0xff800000'
197            bugid: ['966', '965']
198