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: "movi" 17 isa: 18 title: Move immediate-to-register 19 description: > 20 Move integer immediate into a register. For short formats immediate is sign extended to operand size. 21 exceptions: 22 - x_none 23 verification: 24 - none 25 commands: 26 - file-name: "imm_4_8_16_32" 27 isa: 28 instructions: 29 - sig: movi v:out:i32, imm:i32 30 acc: none 31 format: [op_v_4_imm_4, op_v_8_imm_8, op_v_8_imm_16, op_v_8_imm_32] 32 opcode_idx: [0x9, 0xa, 0xb, 0xc] 33 description: Check movi with various values. 34 tags: ['tsan'] 35 check-type: no-check 36 code-template: | 37 # 38 ldai %s 39 movi v0, %s 40 jne v0, set_failure 41 ldai 0 42 return 43 set_failure: 44 ldai 1 45 cases: 46 - values: 47 - 0 48 - 0 49 - values: 50 - 1 51 - 1 52 - values: 53 - -1 54 - -1 55 - values: 56 - 0xF 57 - 0xF 58 - values: 59 - -0xF 60 - -0xF 61 - values: 62 - 0x7F 63 - 0x7F 64 - values: 65 - -0x7F 66 - -0x7F 67 - values: 68 - 0xFF 69 - 0xFF 70 - values: 71 - -0xFF 72 - -0xFF 73 - values: 74 - 0x7FFF 75 - 0x7FFF 76 - values: 77 - -0x7FFF 78 - -0x7FFF 79 - values: 80 - 0xFFFF 81 - 0xFFFF 82 - values: 83 - -0xFFFF 84 - -0xFFFF 85 - values: 86 - 0x7FFFFFFF 87 - 0x7FFFFFFF 88 - values: 89 - -0x7FFFFFFF 90 - -0x7FFFFFFF 91 - values: 92 - 0xFFFFFFFF 93 - 0xFFFFFFFF 94 - values: 95 - -0xFFFFFFFF 96 - -0xFFFFFFFF 97 - values: 98 - 0x12345678 99 - 0x12345678 100 - values: 101 - -0x12345678 102 - -0x12345678 103 - values: 104 - 0xFEDCBA98 105 - 0xFEDCBA98 106 - values: 107 - -0xFEDCBA98 108 - -0xFEDCBA98 109 110 111 - file-name: "vd_4_8" 112 isa: 113 instructions: 114 - sig: movi v:out:i32, imm:i32 115 acc: none 116 format: [op_v_4_imm_4, op_v_8_imm_8, op_v_8_imm_16, op_v_8_imm_32] 117 opcode_idx: [0x9, 0xa, 0xb, 0xc] 118 check-type: no-check 119 code-template: | 120 # 121 ldai 1 122 movi %s, 1 123 jne %s, set_failure 124 ldai 0 125 return 126 set_failure: 127 ldai 1 128 description: Check movi instruction with different register numbers (8 bit). 129 cases: 130 - values: 131 - v0 132 - v0 133 - values: 134 - v1 135 - v1 136 - values: 137 - v15 138 - v15 139 - values: 140 - v16 141 - v16 142 - values: 143 - v255 144 - v255 145 146 147 - file-name: "err" 148 isa: 149 instructions: 150 - sig: movi v:out:i32, imm:i32 151 acc: none 152 format: [op_v_4_imm_4, op_v_8_imm_8, op_v_8_imm_16, op_v_8_imm_32] 153 opcode_idx: [0x9, 0xa, 0xb, 0xc] 154 header-template: [] 155 runner-options: [compile-failure] 156 check-type: exit-positive 157 description: Check movi instruction with syntax error. 158 code-template: | 159 .record panda.Object <external> 160 .function i32 main() { 161 movi %s 162 cases: 163 - values: 164 - '' 165 - values: 166 - v0, v1 167 - values: 168 - v256, 0 169 - values: 170 - v65536, 0 171 - values: 172 - a0, 0 173 - values: 174 - 1, 0 175 - values: 176 - v0 177 - values: 178 - v0, null 179 - values: 180 - v0, "" 181 - values: 182 - v0, panda.Object 183 - values: 184 - v0, 10e10 185 - values: 186 - v0, 0.0000003 187