1# Copyright (c) 2021 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: "and2.64" 17 isa: 18 title: Two address binary operation on accumulator 19 description: > 20 Perform specified binary operation on accumulator and register and store result into accumulator 21 exceptions: 22 - x_none 23 commands: 24 - file-name: "op_vs_8_zero" 25 isa: 26 instructions: 27 - sig: and2.64 v:in:i64 28 acc: inout:i64 29 prefix: bit 30 format: [pref_op_v_8] 31 code-template: | 32 # 33 ldai.64 0 34 movi.64 v0, %s 35 and2.64 v0 36 movi.64 v0, 0 37 cmp.64 v0 38 description: Check 'and2.64' with 0 and various values. 39 tags: ['tsan'] 40 cases: 41 - values: 42 - "0" 43 - values: 44 - "1" 45 - values: 46 - "-1" 47 - values: 48 - "0x7FFFFFFFFFFFFFFF" 49 - values: 50 - "0x8000000000000000" 51 - values: 52 - "-0x7FFFFFFFFFFFFFFF" 53 - values: 54 - "-0x8000000000000000" 55 - values: 56 - "0xFFFFFFFFFFFFFFFF" 57 - values: 58 - "-0xFFFFFFFFFFFFFFFF" 59 60 - file-name: "op_vs_8_pone" 61 isa: 62 instructions: 63 - sig: and2.64 v:in:i64 64 acc: inout:i64 65 prefix: bit 66 format: [pref_op_v_8] 67 code-template: | 68 # 69 ldai.64 1 70 movi.64 v0, %s 71 and2.64 v0 72 movi.64 v0, %s 73 cmp.64 v0 74 description: Check 'and2.64' with +1 and various values. 75 cases: 76 - values: 77 - "0" 78 - "0" 79 - values: 80 - "1" 81 - "1" 82 - values: 83 - "-1" 84 - "1" 85 - values: 86 - "0x7FFFFFFFFFFFFFFF" 87 - "1" 88 - values: 89 - "0x8000000000000000" 90 - "0" 91 - values: 92 - "-0x7FFFFFFFFFFFFFFF" 93 - "1" 94 - values: 95 - "-0x8000000000000000" 96 - "0" 97 - values: 98 - "0xFFFFFFFFFFFFFFFF" 99 - "1" 100 - values: 101 - "-0xFFFFFFFFFFFFFFFF" 102 - "1" 103 - file-name: "op_vs_8_none" 104 isa: 105 instructions: 106 - sig: and2.64 v:in:i64 107 acc: inout:i64 108 prefix: bit 109 format: [pref_op_v_8] 110 code-template: | 111 # 112 ldai.64 -1 113 movi.64 v0, %s 114 and2.64 v0 115 movi.64 v0, %s 116 cmp.64 v0 117 description: Check 'and2.64' with -1 and various values. 118 cases: 119 - values: 120 - "0" 121 - "0" 122 - values: 123 - "1" 124 - "1" 125 - values: 126 - "-1" 127 - "-1" 128 - values: 129 - "0x7FFFFFFFFFFFFFFF" 130 - "0x7FFFFFFFFFFFFFFF" 131 - values: 132 - "0x8000000000000000" 133 - "0x8000000000000000" 134 - values: 135 - "-0x7FFFFFFFFFFFFFFF" 136 - "-0x7FFFFFFFFFFFFFFF" 137 - values: 138 - "-0x8000000000000000" 139 - "-0x8000000000000000" 140 - values: 141 - "0xFFFFFFFFFFFFFFFF" 142 - "0xFFFFFFFFFFFFFFFF" 143 - values: 144 - "-0xFFFFFFFFFFFFFFFF" 145 - "-0xFFFFFFFFFFFFFFFF" 146 - file-name: "op_vs_8_pmax" 147 isa: 148 instructions: 149 - sig: and2.64 v:in:i64 150 acc: inout:i64 151 prefix: bit 152 format: [pref_op_v_8] 153 code-template: | 154 # 155 ldai.64 0x7FFFFFFFFFFFFFFF 156 movi.64 v0, %s 157 and2.64 v0 158 movi.64 v0, %s 159 cmp.64 v0 160 description: Check 'and2.64' with +max and various values. 161 cases: 162 - values: 163 - "0" 164 - "0" 165 - values: 166 - "1" 167 - "1" 168 - values: 169 - "-1" 170 - "0x7FFFFFFFFFFFFFFF" 171 - values: 172 - "0x7FFFFFFFFFFFFFFF" 173 - "0x7FFFFFFFFFFFFFFF" 174 - values: 175 - "0x8000000000000000" 176 - "0" 177 - values: 178 - "-0x7FFFFFFFFFFFFFFF" 179 - "1" 180 - values: 181 - "-0x8000000000000000" 182 - "0" 183 - values: 184 - "0xFFFFFFFFFFFFFFFF" 185 - "0x7FFFFFFFFFFFFFFF" 186 - values: 187 - "-0xFFFFFFFFFFFFFFFF" 188 - "1" 189 190 - file-name: "op_vs_8_nmax" 191 isa: 192 instructions: 193 - sig: and2.64 v:in:i64 194 acc: inout:i64 195 prefix: bit 196 format: [pref_op_v_8] 197 code-template: | 198 # 199 ldai.64 -0x8000000000000000 200 movi.64 v0, %s 201 and2.64 v0 202 movi.64 v0, %s 203 cmp.64 v0 204 description: Check 'and2.64' with -max and various values. 205 cases: 206 - values: 207 - "0" 208 - "0" 209 - values: 210 - "1" 211 - "0" 212 - values: 213 - "-1" 214 - "0x8000000000000000" 215 - values: 216 - "0x7FFFFFFFFFFFFFFF" 217 - "0" 218 - values: 219 - "0x8000000000000000" 220 - "0x8000000000000000" 221 - values: 222 - "-0x7FFFFFFFFFFFFFFF" 223 - "0x8000000000000000" 224 - values: 225 - "-0x8000000000000000" 226 - "0x8000000000000000" 227 - values: 228 - "0xFFFFFFFFFFFFFFFF" 229 - "0x8000000000000000" 230 - values: 231 - "-0xFFFFFFFFFFFFFFFF" 232 - "0" 233 234 - file-name: "vals" 235 isa: 236 instructions: 237 - sig: and2.64 v:in:i64 238 acc: inout:i64 239 prefix: bit 240 format: [pref_op_v_8] 241 code-template: | 242 # 243 ldai.64 %s 244 movi.64 v0, %s 245 and2.64 v0 246 movi.64 v0, %s 247 cmp.64 v0 248 description: Check 'and2.64' with various values. 249 cases: 250 - values: 251 - "0xF5A45D7ACCBEC81" 252 - "0x147F4564FF6F1ED5" 253 - "0x45A4544AC4B0C81" 254 - values: 255 - "0xDF39DF86B11764D0" 256 - "0x75B89CAD1D10139A" 257 - "0x55389C8411100090" 258 - values: 259 - "0x3675DE31C3B8C2EB" 260 - "0x9742C7DD1AF22B02" 261 - "0x1640C61102B00202" 262 - values: 263 - "0x933C8AD6FCBE6C91" 264 - "0xC89958DE38723023" 265 - "0x801808D638322001" 266 - values: 267 - "0xE229E2ED8D27FA8D" 268 - "0xF9E7F03098B8F407" 269 - "0xE021E0208820F005" 270 - values: 271 - "0x79A8933846E38688" 272 - "0x8B070E6E6081D938" 273 - "0x900022840818008" 274 - values: 275 - "0xF824D81EBB55FB0" 276 - "0xDC15FC1619348164" 277 - "0xC004C0009340120" 278 - values: 279 - "0xC4C29D2DDBAAB1FD" 280 - "0xFD34C8AFD9D06B2D" 281 - "0xC400882DD980212D" 282 - values: 283 - "0x4D324906B5990E35" 284 - "0xE4CC0CDACEFBEB79" 285 - "0x4400080284990A31" 286 - values: 287 - "0x7F56BCCEBBE25550" 288 - "0x9BCD499BC691652F" 289 - "0x1B44088A82804500" 290 291 - file-name: "regs" 292 isa: 293 instructions: 294 - sig: and2.64 v:in:i64 295 acc: inout:i64 296 prefix: bit 297 format: [pref_op_v_8] 298 runner-options: ['compile-only'] 299 code-template: | 300 # 301 and2.64 %s 302 check-type: none 303 description: Check 'and2.64' with various register numbers. 304 cases: 305 - values: 306 - "v255" 307 - values: 308 - "v256" 309 runner-options: ['compile-failure'] 310 311 - file-name: "type" 312 bugid: ["964", "966", '2090', '2107'] 313 isa: 314 instructions: 315 - sig: and2.64 v:in:i64 316 acc: inout:i64 317 prefix: bit 318 format: [pref_op_v_8] 319 verification: 320 - acc_type 321 - v1_type 322 tags: ['verifier'] 323 runner-options: ['verifier-failure', 'verifier-debug-config'] 324 header-template: [] 325 code-template: | 326 # 327 .record A {} 328 .record B {} 329 .record panda.String <external> 330 .record panda.Object <external> 331 .function i32 main() { 332 %s 333 *s 334 and2.64 v1 335 ldai 0 336 check-type: no-check 337 description: Check and2.64 with incorrect register type. 338 template-cases: 339 - values: 340 - ldai 0 341 - values: 342 - fldai.64 0 343 bugid: ['3930'] 344 ignore: true 345 - values: 346 - | 347 # 348 lda.type B 349 - values: 350 - | 351 # 352 lda.type B[] 353 - values: 354 - | 355 # 356 lda.type panda.String 357 - values: 358 - | 359 # 360 lda.type panda.Object 361 - values: 362 - | 363 # 364 movi v0, 10 365 newarr v0, v0, i32[] 366 lda.obj v0 367 - values: 368 - lda.null 369 - values: 370 - ldai.64 0 371 exclude: [val] 372 cases: 373 - values: 374 - movi v1, 0 375 - values: 376 - fmovi.64 v1, 0 377 bugid: ['3930'] 378 ignore: true 379 - values: 380 - | 381 # 382 lda.type A 383 sta.obj v1 384 - values: 385 - | 386 # 387 lda.type A[] 388 sta.obj v1 389 390 - values: 391 - | 392 # 393 lda.type panda.String 394 sta.obj v1 395 - values: 396 - | 397 # 398 lda.type panda.Object 399 sta.obj v1 400 - values: 401 - | 402 # 403 movi v1, 10 404 newarr v1, v1, f64[] 405 - values: 406 - mov.null v1 407 - values: 408 - movi.64 v1, 0 409 id: val 410 411 - file-name: uninitialized_regs 412 bugid: ['2260'] 413 isa: 414 instructions: 415 - sig: and2.64 v:in:i64 416 acc: inout:i64 417 prefix: bit 418 format: [pref_op_v_8] 419 description: Check and2.64 with uninitialized registers. 420 tags: ['verifier'] 421 runner-options: ['verifier-failure', 'verifier-debug-config'] 422 header-template: [] 423 code-template: | 424 # 425 .function i32 main() { 426 %s 427 *s 428 and2.64 *s 429 ldai 0 430 check-type: no-check 431 template-cases: 432 - values: 433 - '' 434 - values: 435 - ldai.64 0 436 exclude: [init] 437 438 cases: 439 - values: 440 - '' 441 - v0 442 - values: 443 - movi.64 v1, 0 444 - v1 445 id: init 446 - values: 447 - '' 448 - v8 449 - values: 450 - '' 451 - v15 452 - values: 453 - movi.64 v15, 0 454 - v15 455 id: init 456 457