• 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: ldai.64
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: ldai.64 imm:i64
30              acc: out:i64
31              format: [op_imm_64]
32        check-type: no-check
33        code-template: |
34          #
35              ldai.64 %s
36              movi.64 v0, %s
37              cmp.64 v0
38        description: Check ldai.64 with various positive values.
39        tags: ['tsan']
40        cases:
41          - values:
42              - '0x0'
43              - '0x0'
44          - values:
45              - '0'
46              - '0'
47          - values:
48              - '1'
49              - '1'
50          - values:
51              - '0x7FFFFFFFFFFFFFFF'
52              - '0x7FFFFFFFFFFFFFFF'
53          - values:
54              - '0x1234567890ABCDEF'
55              - '0x1234567890ABCDEF'
56          - values:
57              - '0x7FFFFFFFFFFFFFFF'
58              - '0x7FFFFFFFFFFFFFFF'
59          - values:
60              - '0x8000000000000000'
61              - '0x8000000000000000'
62          - values:
63              - '0.0'
64              - '0'
65            runner-options: [compile-failure]
66            description: Check ldai.64 with incorrect positive values (float).
67          - values:
68              - '1.0'
69              - '1'
70            runner-options: [compile-failure]
71            description: Check ldai.64 with incorrect positive values (float).
72
73      - file-name: neg
74        isa:
75          instructions:
76            - sig: ldai.64 imm:i64
77              acc: out:i64
78              format: [op_imm_64]
79        check-type: no-check
80        code-template: |
81          #
82              ldai.64 %s
83              movi.64 v0, %s
84              cmp.64 v0
85        description: Check ldai.64 with various negative values.
86        cases:
87          - values:
88              - '-0x0'
89              - '0x0'
90          - values:
91              - '-0'
92              - '0'
93          - values:
94              - '-1'
95              - '-1'
96          - values:
97              - '-0x7FFFFFFFFFFFFFFF'
98              - '-9223372036854775807‬'
99            runner-options: [compile-failure]
100          - values:
101              - '-0x1234567890ABCDEF'
102              - '-0x1234567890ABCDEF'
103          - values:
104              - '-0x8000000000000000'
105              - '0x8000000000000000'
106          - values:
107              - '-0.0'
108              - '0'
109            runner-options: [compile-failure]
110            description: Check ldai.64 with incorrect negative values (float).
111          - values:
112              - '-1.0'
113              - '-1'
114            runner-options: [compile-failure]
115            description: Check ldai.64 with incorrect negative values (float).
116