# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. definitions: [] tests: - file-name: 'ucmp.64' isa: title: Integer comparison description: Perform specified signed or unsigned integer comparison between register and accumulator. exceptions: - x_none commands: - file-name: 'op_vs_8_eq' isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] check-type: check-positive description: Check ucmp.64 with equal values. code-template: | # test - compare equal values ldai.64 %s movi.64 v0, %s ucmp.64 v0 cases: - values: - '0' - '0x0000000000000000' - values: - '1' - '0x0000000000000001' - values: - '0x7fffffffffffffff' - '9223372036854775807' - values: - '9223372036854775808' - '0x8000000000000000' - values: - '0xCAFEBABECAFEBABE' - '14627333968358193854' - file-name: 'op_vs_8_lt' isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] tags: ['irtoc_ignore'] check-type: check-positive description: Check ucmp.64 with different values. code-template: | # test - check less than ldai.64 %s movi.64 v0, %s ucmp.64 v0 addi 1 cases: - values: - '0' - '0x0000000000000001' - values: - '9223372036854775707' - '9223372036854775807' - values: - '0x7fffffffffffffff' - '0x8000000000000000' - values: - '0x8000000000000000' - '0x8000000000000001' - values: - '0x7ffffffffffffffe' - '9223372036854775807' - values: - '65535' - '0x00010000' - file-name: 'op_vs_8_gt' isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] check-type: check-positive description: Check ucmp.64 with different values. tags: ['tsan', 'irtoc_ignore'] code-template: | # test - check greater than ldai.64 %s movi.64 v0, %s ucmp.64 v0 subi 1 cases: - values: - '0x0000000000000001' - '0' - values: - '9223372036854775807' - '9223372036854775707' - values: - '0x8000000000000000' - '0x7fffffffffffffff' - values: - '0x8000000000000001' - '0x8000000000000000' - values: - '9223372036854775807' - '0x7ffffffffffffffe' - values: - '0x00010000' - '65535' - file-name: 'op_vs_8_reg256' isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] check-type: exit-positive runner-options: [compile-failure] description: Check ucmp.64 with incorrect register numbers. code-template: | # ucmp.64 v256 - file-name: 'op_vs_8_reg255' isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] check-type: exit-positive runner-options: [compile-only] description: Check ucmp.64 with correct register numbers. code-template: | # ucmp.64 v255 - file-name: type isa: verification: - v1_type - acc_type tags: ['verifier'] runner-options: ['verifier-failure', 'verifier-config'] header-template: [] code-template: | # .record A {} .record B {} .record panda.String .record panda.Object .function i32 main() { %s *s ucmp.64 v0 check-type: exit-positive description: Check 'ucmp.64' with incorrect register type. template-cases: - values: - movi v0, 0 - values: - fmovi v0, 0 - values: - movi.64 v0, 0 exclude: [val] - values: - fmovi.64 v0, 0 - values: - | # lda.type B sta.obj v0 - values: - | # lda.type B[] sta.obj v0 - values: - | # lda.type panda.String sta.obj v0 - values: - | # lda.str "string" sta.obj v0 - values: - | # movi v0, 10 newarr v0, v0, i32[] - values: - mov.null v0 cases: - values: - ldai 0 - values: - fldai 0 - values: - ldai.64 0 id: val - values: - fldai.64 0 - values: - | # lda.type A - values: - | # lda.type A[] - values: - | # lda.type panda.String - values: - | # lda.str "string" - values: - | # movi v1, 10 newarr v1, v1, f64[] lda.obj v1 - values: - lda.null - file-name: uninitialized_regs isa: instructions: - sig: ucmp.64 v:in:u64 acc: inout:u64->i32 prefix: unsigned format: [pref_op_v_8] description: Check 'ucmp.64' with uninitialized registers. tags: ['verifier'] runner-options: ['verifier-failure', 'verifier-config'] header-template: [] code-template: | # .function i32 main() { %s *s ucmp.64 %s check-type: exit-positive template-cases: - values: - '' - v0 - values: - movi.64 v0, 0 - v0 exclude: [init] - values: - '' - v7 - values: - '' - v15 - values: - 'movi.64 v15, 0' - v15 exclude: [init] - values: - '' - v128 - values: - 'movi.64 v128, 0' - v128 exclude: [init] - values: - '' - v255 - values: - 'movi.64 v255, 0' - v255 exclude: [init] cases: - values: - '' - values: - ldai.64 0 id: init