# 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: fcmpl.64 isa: title: Floating-point comparison description: Perform specified floating point comparison between register and accumulator. exceptions: - x_none commands: - file-name: op_vs_8_zero isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] tags: ['irtoc_ignore'] description: Check fcmpl.64 compares zero with other zero values. code-template: | # fldai.64 %s fmovi.64 v0, %s fcmpl.64 v0 check-type: check-positive cases: - values: - '0.0' - '0.0' - values: - '-0.0' - '-0.0' - values: - '-0.0' - '0.0' - values: - '0.0' - '-0.0' - file-name: op_vs_8_nan isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] tags: ['irtoc_ignore'] code-template: | # test - check binary representation and comparison of FP literals - NaN fldai.64 0x7ff8000000000000 fmovi.64 v0, %s fcmpl.64 v0 check-type: check-acc-minus-1 description: Check fcmpl.64 compares NaN values. cases: - values: - '0x7ff8000000000000' - values: - '0x7ff8000000000001' - values: - '0x7ff8000000000010' - values: - '0x7fffffffffffffff' - values: - '0xFFFFFFFFFFFFFFFF' - values: - '0x7ff8123456789012' - values: # +Inf - '0x7ff0000000000000' description: Check fcmpl.64 compares NaN with +Inf - values: # -Inf - '0xfff0000000000000' description: Check fcmpl.64 compares NaN with -Inf - file-name: op_vs_8_nan_numbers_1 isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] description: Check fcmpl.64 compares NaN with various values. tags: ['irtoc_ignore'] code-template: | # test - check comparison of NaN with values fldai.64 0x7ff8000000000000 # One of valid NaN values fmovi.64 v0, %s fcmpl.64 v0 check-type: check-acc-minus-1 cases: - values: - '4e300' - values: - '0.0' - values: - '-1.0e20' - file-name: op_vs_8_numbers_2 isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] code-template: | # test - check comparison of values fldai.64 %s fmovi.64 v0, %s movi v1, %s fcmpl.64 v0 jne v1, set_failure ldai 0 return set_failure: ldai 1 return check-type: none description: Check fcmpl.64 compares various values. tags: ['tsan', 'irtoc_ignore'] cases: - values: - '1.0' - '0.0' - '1' - values: - '12345678.9098765' - '12345678.9098764' - '1' - values: - '12345678.9098765' - '-12345678.9098765' - '1' - values: - '-1.0' - '0.0' - '-1' - values: - '-12345678.9098765' - '0.0' - '-1' - values: - '-12345678.9098765' - '12345678.9098765' - '-1' - values: - '-12345678.9098765' - '12345678.9098765' - '-1' - file-name: op_vs_8_pinf isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] description: Check fcmpl.64 compares positive Inf with various values. tags: ['irtoc_ignore'] code-template: | # test - check comparison of values # +Inf fldai.64 0x7ff0000000000000 fmovi.64 v0, %s fcmpl.64 v0 check-type: check-acc-1 cases: - values: - '1.0' - values: - '12345678.9098765' - values: - '-12345678.9098765' - values: - '-1.0' - values: - '4e300' - values: - '-4e300' - file-name: op_vs_8_ninf isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] description: Check fcmpl.64 compares negative Inf with various values. tags: ['irtoc_ignore'] code-template: | # test - check comparison of values # -Inf fldai.64 0xfff0000000000000 fmovi.64 v0, %s fcmpl.64 v0 check-type: check-acc-minus-1 cases: - values: - '1.0' - values: - '12345678.9098765' - values: - '-12345678.9098765' - values: - '-1.0' - values: - '4e300' - values: - '-4e300' - file-name: op_vs_8_inf isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] tags: ['irtoc_ignore'] code-template: | # test - check comparison of values fldai.64 %s # +Inf fmovi.64 v0, %s movi v1, %s fcmpl.64 v0 jne v1, set_failure ldai 0 return set_failure: ldai 1 return check-type: none cases: - values: # -Inf - '0xfff0000000000000' - '0x7ff0000000000000' - '-1' - values: - '0x7ff0000000000000' # -Inf - '0xfff0000000000000' - '+1' - file-name: incorrect_register isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] runner-options: [compile-failure] description: Check fcmpl.64 with incorrect register numbers. code-template: | # fcmpl.64 %s check-type: exit-positive cases: - values: [v256] - values: [a0] - values: [0] - values: ['1.1'] - values: [1.1] - file-name: applicable_register isa: instructions: - sig: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] runner-options: [compile-only] description: Check fcmpl.64 with correct register numbers. code-template: | # fldai.64 0.0 %s check-type: exit-positive cases: - values: - '#{[*0..255].map do |i| " fmovi.64 v#{i}, 0\n fcmpl.64 v#{i}\n" end .join}' - 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 fcmpl.64 v0 check-type: exit-positive description: Check 'fcmpl.64' with incorrect register type. template-cases: - values: - movi v0, 0 - values: - fmovi v0, 0 bugid: ['6094'] - values: - movi.64 v0, 0 - values: - fmovi.64 v0, 0 exclude: [val] - 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 bugid: ['6094'] - values: - ldai.64 0 - values: - fldai.64 0 id: val - 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: fcmpl.64 v:in:f64 acc: inout:f64->i32 format: [op_v_8] description: Check 'fcmpl.64' with uninitialized registers. tags: ['verifier'] runner-options: ['verifier-failure', 'verifier-config'] header-template: [] code-template: | # .function i32 main() { %s *s fcmpl.64 %s check-type: exit-positive template-cases: - values: - '' - v0 - values: - fmovi.64 v0, 0 - v0 exclude: [init] - values: - '' - v7 - values: - '' - v15 - values: - 'fmovi.64 v15, 0' - v15 exclude: [init] - values: - '' - v128 - values: - 'fmovi.64 v128, 0' - v128 exclude: [init] - values: - '' - v255 - values: - 'fmovi.64 v255, 0' - v255 exclude: [init] cases: - values: - '' - values: - fldai.64 0 id: init