• 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: 'neg.64'
17    isa:
18      title: Unary
19      description: >
20        Perform specified operation on accumulator
21      exceptions:
22        - x_none
23
24    commands:
25      - file-name: 'op_none'
26        isa:
27          instructions:
28            - sig: neg.64
29              acc: inout:i64
30              format: [op_none]
31        code-template: |
32          #
33              ldai.64 %s
34              neg.64
35              movi.64 v0, %s
36              cmp.64 v0
37        check-type: no-check
38        description: Check `neg.64` with various values.
39        tags: ['tsan']
40        cases:
41          - values: ['0', '0x0']
42          - values: ['1', '0xFFFFFFFFFFFFFFFF']
43          - values: ['0xF', '0xFFFFFFFFFFFFFFF1']
44          - values: ['0xFF', '0xFFFFFFFFFFFFFF01']
45          - values: ['0xFFF', '0xFFFFFFFFFFFFF001']
46          - values: ['0xFFFF', '0xFFFFFFFFFFFF0001']
47          - values: ['0xFFFFF', '0xFFFFFFFFFFF00001']
48          - values: ['0xFFFFFF', '0xFFFFFFFFFF000001']
49          - values: ['0xFFFFFFF', '0xFFFFFFFFF0000001']
50          - values: ['0xFFFFFFFF', '0xFFFFFFFF00000001']
51          - values: ['0xFFFFFFFFF', '0xFFFFFFF000000001']
52          - values: ['0xFFFFFFFFFF', '0xFFFFFF0000000001']
53          - values: ['0xFFFFFFFFFFF', '0xFFFFF00000000001']
54          - values: ['0xFFFFFFFFFFFF', '0xFFFF000000000001']
55          - values: ['0xFFFFFFFFFFFFF', '0xFFF0000000000001']
56          - values: ['0xFFFFFFFFFFFFFF', '0xFF00000000000001']
57          - values: ['0xFFFFFFFFFFFFFFF', '0xF000000000000001']
58          - values: ['0xFFFFFFFFFFFFFFFF', '0x1']
59          - values: ['0x8000000000000000', '0x8000000000000000']
60            tags: [sanitizer-fail]
61          - values: ['0x7FFFFFFFFFFFFFFF', '0x8000000000000001']
62          - values: ['-0x7FFFFFFFFFFFFFFF', '0x7FFFFFFFFFFFFFFF']
63
64      - file-name: 'vals'
65        isa:
66          instructions:
67            - sig: neg.64
68              acc: inout:i64
69              format: [op_none]
70        code-template: |
71          #
72              ldai.64 %s
73              neg.64
74              movi.64 v0, %s
75              cmp.64 v0
76        check-type: no-check
77        description: Check `neg.64` with various values.
78        cases:
79          - values: ['0xA0A667118E49E5ED', '0x5F5998EE71B61A13']
80          - values: ['0xD9C348FFDAD250BC', '0x263CB700252DAF44']
81          - values: ['0xCC9A2D1C0FF85B1E', '0x3365D2E3F007A4E2']
82          - values: ['0xD02122DF5FB2456D', '0x2FDEDD20A04DBA93']
83          - values: ['0x5ABD58FAF0BE5ABD', '0xA542A7050F41A543']
84          - values: ['0x6ABBE5E3CCFB6422', '0x95441A1C33049BDE']
85          - values: ['0xDAE4BFB7C0BCAF0D', '0x251B40483F4350F3']
86          - values: ['0x8B8EDF2D3CE1F37D', '0x747120D2C31E0C83']
87          - values: ['0x55093AE5F02E0E03', '0xAAF6C51A0FD1F1FD']
88          - values: ['0x33E30F2EB121E7A', '0xFCC1CF0D14EDE186']
89          - values: ['0xC22BDBC17C25BB5C', '0x3DD4243E83DA44A4']
90          - values: ['0x79B490F098C75FA6', '0x864B6F0F6738A05A']
91          - values: ['0x6D11CFA9196A19D5', '0x92EE3056E695E62B']
92          - values: ['0xBFA95B99EC1D2054', '0x4056A46613E2DFAC']
93          - values: ['0xFA65DBDFC3ECBB8B', '0x59A24203C134475']
94          - values: ['0x53F5EDC89AFE89C6', '0xAC0A12376501763A']
95          - values: ['0x80231663CE443B2', '0xF7FDCE99C31BBC4E']
96          - values: ['0x4E5AD26973851CEF', '0xB1A52D968C7AE311']
97          - values: ['0xF619BEB33CC16E24', '0x9E6414CC33E91DC']
98          - values: ['0x8514D176A0789D2B', '0x7AEB2E895F8762D5']
99
100      - file-name: type
101        bugid: ['964', '966', '2090']
102        tags: ['verifier']
103        isa:
104          instructions:
105            - sig: neg.64
106              acc: inout:i64
107              format: [op_none]
108          verification:
109            - acc_type
110        runner-options: ['verifier-failure', 'verifier-config']
111        header-template: []
112        code-template: |
113          .record T {}
114          .record panda.String <external>
115          .record panda.Object <external>
116          #
117          .function i32 main() {
118              %s
119              neg.64
120        check-type: exit-positive
121        description: Check `neg.64` with incorrect accumulator type.
122        cases:
123          - values:
124              - ldai 1
125          - values:
126              - fldai 1
127          - values:
128              - fldai.64 1.0
129          - values:
130              - lda.type T
131          - values:
132              - lda.type T[]
133          - values:
134              - lda.type panda.Object
135          - values:
136              - lda.type panda.String
137          - values:
138              - lda.str "x"
139          - values:
140              - |
141                newobj v0, T
142                lda.obj v0
143          - values:
144              - lda.null
145          - values:
146              - |
147                #
148                    movi v0, 10
149                    newarr v0, v0, i32[]
150                    lda.obj v0
151
152      - file-name: uninitialized_regs
153        bugid: ['2787']
154        tags: ['verifier']
155        isa:
156          instructions:
157            - sig: neg.64
158              acc: inout:i64
159              format: [op_none]
160        description: Check neg.64 with uninitialized accumulator.
161        runner-options: ['verifier-failure', 'verifier-config']
162        header-template: []
163        code-template: |
164          #
165          .function i32 main() {
166              # acc is undefined
167              neg.64
168        check-type: exit-positive
169