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: "fldai.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: "op_imm_64_bits_positive" 27 isa: 28 instructions: 29 - sig: fldai.64 imm:f64 30 acc: out:f64 31 format: [op_imm_64] 32 properties: [acc_write, float] 33 code-template: | 34 # test - check binary representation of FP literals - positive 35 fldai.64 %s 36 fmovi.64 v0, %s 37 fcmpg.64 v0 38 description: Check fldai.64 with various positive values (f64 and HEX literal). 39 tags: ['tsan'] 40 cases: 41 - values: 42 - "0.0" 43 - "0x0" 44 - values: 45 - "0.1" 46 - "0x3FB999999999999A" 47 - values: 48 - "1.0" 49 - "0x3ff0000000000000" 50 - values: 51 - "12345678.90987654" 52 - "0x41678c29dd1db568" 53 - values: 54 - "3.141592653589793" 55 - "0x400921fb54442d18" 56 - values: 57 - "3.1415e3" 58 - "0x40a88b0000000000" 59 - values: 60 - "1.7976931348623157e308" 61 - "0x7FEFFFFFFFFFFFFF" 62 - values: 63 - "4.9e-324" 64 - "0x1" 65 - values: 66 - "1.7976931348623157e308" 67 - "0x7fefffffffffffff" 68 - values: 69 - "0x1234567890ABCDEF" 70 - "5.626349108908516e-221" 71 - values: 72 - "0" 73 - "0x0000000000000000" 74 - values: 75 - "1" 76 - "0x3ff0000000000000" 77 - values: 78 - "0" 79 - "0x0000000000000000" 80 - values: 81 - "1" 82 - "0x3ff0000000000000" 83 - values: 84 - "9223372036854775807" 85 - "0x43e0000000000000" 86 - values: 87 - "0.55" 88 - "0x3fe199999999999a" 89 90 - file-name: "op_imm_64_bits_negative" 91 isa: 92 instructions: 93 - sig: fldai.64 imm:f64 94 acc: out:f64 95 format: [op_imm_64] 96 properties: [acc_write, float] 97 code-template: | 98 # test - check binary representation of FP literals - negative 99 fldai.64 %s 100 fmovi.64 v0, %s 101 fcmpg.64 v0 102 description: Check fldai.64 with various negative values (f64 and HEX literal). 103 cases: 104 - values: 105 - "-0" 106 - "0x8000000000000000" 107 - values: 108 - "-1" 109 - "0xbff0000000000000" 110 - values: 111 - "-0x7FFFFFFFFFFFFFFF" 112 - "0xc3e0000000000000" 113 - values: 114 - "-0.0" 115 - "0x8000000000000000" 116 - values: 117 - "-0.1" 118 - "0xbfb999999999999a" 119 - values: 120 - "-1.0" 121 - "0xbff0000000000000" 122 - values: 123 - "-12345678.90987654" 124 - "0xc1678c29dd1db568" 125 - values: 126 - "-3.141592653589793" 127 - "0xc00921fb54442d18" 128 - values: 129 - "-4.9e-324" 130 - "0x8000000000000001" 131 - values: 132 - "-1.7976931348623157e308" 133 - "0xffefffffffffffff" 134 - values: 135 - "-0.55" 136 - "0xbfe199999999999a" 137 138 - file-name: "op_imm_64_err" 139 isa: 140 instructions: 141 - sig: fldai.64 imm:f64 142 acc: out:f64 143 format: [op_imm_64] 144 properties: [acc_write, float] 145 code-template: | 146 # 147 fldai.64 %s 148 check-type: none 149 runner-options: [compile-failure] 150 description: Check fldai.64 with incorrect literal. 151 cases: 152 153 - values: 154 - "1e" 155 - values: 156 - "e1" 157 ignore: true 158 bugid: ['932'] 159 - values: 160 - "-1e" 161 - values: 162 - "-e1" 163 ignore: true 164 bugid: ['932'] 165 - values: 166 - "1e1e1" 167 - values: 168 - "-1e1e1" 169 170 - file-name: "op_imm_64_range" 171 isa: 172 instructions: 173 - sig: fldai.64 imm:f64 174 acc: out:f64 175 format: [op_imm_64] 176 properties: [acc_write, float] 177 code-template: | 178 # 179 fldai.64 %s 180 check-type: none 181 runner-options: [compile-only] 182 description: Check fldai.64 with minimal/maximal positive/negative values. 183 cases: 184 - values: 185 - "+2e-324" 186 - values: 187 - "-2e-324" 188 - values: 189 - "1.8e328" 190 tags: ["clang_release_sanitizer"] 191 bugid: ["966", "965"] 192 - values: 193 - "-1.8e328" 194 bugid: ["966", "965"] 195 tags: ["clang_release_sanitizer"] 196 197 - file-name: "op_imm_64_range_val" 198 isa: 199 instructions: 200 - sig: fldai.64 imm:f64 201 acc: out:f64 202 format: [op_imm_64] 203 properties: [acc_write, float] 204 code-template: | 205 # test - check binary representation of FP literals - positive 206 fldai.64 %s 207 fmovi.64 v0, %s 208 fcmpg.64 v0 209 description: Check fldai.64 with out-of-range positive/negative values. 210 cases: 211 - values: 212 - "+2e-325" 213 - "0" 214 - values: 215 - "-2e-325" 216 - "0x8000000000000000" 217 - values: 218 - "1.8e328" 219 - "0x7ff0000000000000" 220 tags: ["clang_release_sanitizer"] 221 bugid: ["966", "965"] 222 - values: 223 - "-1.8e328" 224 - "0xfff0000000000000" 225 tags: ["clang_release_sanitizer"] 226 bugid: ["966", "965"] 227