github.com/tetratelabs/wazero@v1.7.1/internal/engine/wazevo/backend/isa/arm64/instr_encoding_test.go (about) 1 package arm64 2 3 import ( 4 "encoding/binary" 5 "encoding/hex" 6 "fmt" 7 "math" 8 "testing" 9 10 "github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc" 11 "github.com/tetratelabs/wazero/internal/engine/wazevo/ssa" 12 "github.com/tetratelabs/wazero/internal/testing/require" 13 ) 14 15 func Test_dummy(t *testing.T) { 16 require.Equal(t, dummyInstruction, encodeUnconditionalBranch(false, 0)) 17 } 18 19 func TestInstruction_encode(t *testing.T) { 20 dummyLabel := label(1) 21 for _, tc := range []struct { 22 setup func(*instruction) 23 want string 24 }{ 25 {want: "3f441bd5", setup: func(i *instruction) { i.asMovToFPSR(xzrVReg) }}, 26 {want: "21441bd5", setup: func(i *instruction) { i.asMovToFPSR(x1VReg) }}, 27 {want: "21443bd5", setup: func(i *instruction) { i.asMovFromFPSR(x1VReg) }}, 28 {want: "2f08417a", setup: func(i *instruction) { i.asCCmpImm(operandNR(x1VReg), 1, eq, 0b1111, false) }}, 29 {want: "201841fa", setup: func(i *instruction) { i.asCCmpImm(operandNR(x1VReg), 1, ne, 0, true) }}, 30 {want: "410c010e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) }}, 31 {want: "410c014e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) }}, 32 {want: "410c020e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) }}, 33 {want: "410c024e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) }}, 34 {want: "410c040e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) }}, 35 {want: "410c044e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) }}, 36 {want: "410c084e", setup: func(i *instruction) { i.asVecDup(operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) }}, 37 {want: "4104034e", setup: func(i *instruction) { i.asVecDupElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementB, 1) }}, 38 {want: "4104064e", setup: func(i *instruction) { i.asVecDupElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementH, 1) }}, 39 {want: "41040c4e", setup: func(i *instruction) { i.asVecDupElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementS, 1) }}, 40 {want: "4104184e", setup: func(i *instruction) { i.asVecDupElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementD, 1) }}, 41 {want: "4138032e", setup: func(i *instruction) { 42 i.asVecExtract(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B, 7) 43 }}, 44 {want: "4138036e", setup: func(i *instruction) { 45 i.asVecExtract(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B, 7) 46 }}, 47 {want: "410c036e", setup: func(i *instruction) { i.asVecMovElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementB, 1, 1) }}, 48 {want: "4114066e", setup: func(i *instruction) { i.asVecMovElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementH, 1, 1) }}, 49 {want: "41240c6e", setup: func(i *instruction) { i.asVecMovElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementS, 1, 1) }}, 50 {want: "4144186e", setup: func(i *instruction) { i.asVecMovElement(operandNR(v1VReg), operandNR(v2VReg), vecArrangementD, 1, 1) }}, 51 {want: "4104090f", setup: func(i *instruction) { 52 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement8B) 53 }}, 54 {want: "4104094f", setup: func(i *instruction) { 55 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement16B) 56 }}, 57 {want: "4104190f", setup: func(i *instruction) { 58 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement4H) 59 }}, 60 {want: "4104194f", setup: func(i *instruction) { 61 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement8H) 62 }}, 63 {want: "4104390f", setup: func(i *instruction) { 64 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement2S) 65 }}, 66 {want: "4104394f", setup: func(i *instruction) { 67 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement4S) 68 }}, 69 {want: "4104794f", setup: func(i *instruction) { 70 i.asVecShiftImm(vecOpSshr, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(7), vecArrangement2D) 71 }}, 72 73 {want: "41a40d0f", setup: func(i *instruction) { 74 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement8B) 75 }}, 76 {want: "41a40d4f", setup: func(i *instruction) { // sshll2 77 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement16B) 78 }}, 79 {want: "41a41d0f", setup: func(i *instruction) { 80 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement4H) 81 }}, 82 {want: "41a41d4f", setup: func(i *instruction) { // sshll2 83 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement8H) 84 }}, 85 {want: "41a43d0f", setup: func(i *instruction) { 86 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement2S) 87 }}, 88 {want: "41a43d4f", setup: func(i *instruction) { // sshll2 89 i.asVecShiftImm(vecOpSshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement4S) 90 }}, 91 {want: "41a40d2f", setup: func(i *instruction) { 92 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement8B) 93 }}, 94 {want: "41a40d6f", setup: func(i *instruction) { // ushll2 95 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement16B) 96 }}, 97 {want: "41a41d2f", setup: func(i *instruction) { 98 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement4H) 99 }}, 100 {want: "41a41d6f", setup: func(i *instruction) { // ushll2 101 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement8H) 102 }}, 103 {want: "41a43d2f", setup: func(i *instruction) { 104 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement2S) 105 }}, 106 {want: "41a43d6f", setup: func(i *instruction) { // ushll2 107 i.asVecShiftImm(vecOpUshll, operandNR(v1VReg), operandNR(v2VReg), operandShiftImm(3), vecArrangement4S) 108 }}, 109 {want: "4100030e", setup: func(i *instruction) { 110 i.asVecTbl(1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 111 }}, 112 {want: "4100034e", setup: func(i *instruction) { 113 i.asVecTbl(1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 114 }}, 115 {want: "4120040e", setup: func(i *instruction) { 116 i.asVecTbl(2, operandNR(v1VReg), operandNR(v2VReg), operandNR(v4VReg), vecArrangement8B) 117 }}, 118 {want: "4120044e", setup: func(i *instruction) { 119 i.asVecTbl(2, operandNR(v1VReg), operandNR(v2VReg), operandNR(v4VReg), vecArrangement16B) 120 }}, 121 {want: "4138030e", setup: func(i *instruction) { 122 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 123 }}, 124 {want: "4138034e", setup: func(i *instruction) { 125 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 126 }}, 127 {want: "4138430e", setup: func(i *instruction) { 128 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 129 }}, 130 {want: "4138434e", setup: func(i *instruction) { 131 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 132 }}, 133 {want: "4138830e", setup: func(i *instruction) { 134 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 135 }}, 136 {want: "4138834e", setup: func(i *instruction) { 137 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 138 }}, 139 {want: "4138c34e", setup: func(i *instruction) { 140 i.asVecPermute(vecOpZip1, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 141 }}, 142 {want: "411ca32e", setup: func(i *instruction) { 143 i.asVecRRRRewrite(vecOpBit, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 144 }}, 145 {want: "411ca36e", setup: func(i *instruction) { 146 i.asVecRRRRewrite(vecOpBit, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 147 }}, 148 {want: "411c236e", setup: func(i *instruction) { 149 i.asVecRRR(vecOpEOR, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 150 }}, 151 {want: "411c232e", setup: func(i *instruction) { 152 i.asVecRRR(vecOpEOR, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 153 }}, 154 {want: "4184234e", setup: func(i *instruction) { 155 i.asVecRRR(vecOpAdd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 156 }}, 157 {want: "4184a34e", setup: func(i *instruction) { 158 i.asVecRRR(vecOpAdd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 159 }}, 160 {want: "4184e34e", setup: func(i *instruction) { 161 i.asVecRRR(vecOpAdd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 162 }}, 163 {want: "410c230e", setup: func(i *instruction) { 164 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 165 }}, 166 {want: "410c234e", setup: func(i *instruction) { 167 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 168 }}, 169 {want: "410c630e", setup: func(i *instruction) { 170 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 171 }}, 172 {want: "410c634e", setup: func(i *instruction) { 173 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 174 }}, 175 {want: "410ca30e", setup: func(i *instruction) { 176 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 177 }}, 178 {want: "410ca34e", setup: func(i *instruction) { 179 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 180 }}, 181 {want: "410ce34e", setup: func(i *instruction) { 182 i.asVecRRR(vecOpSqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 183 }}, 184 {want: "410c232e", setup: func(i *instruction) { 185 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 186 }}, 187 {want: "410c236e", setup: func(i *instruction) { 188 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 189 }}, 190 {want: "410c632e", setup: func(i *instruction) { 191 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 192 }}, 193 {want: "410c636e", setup: func(i *instruction) { 194 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 195 }}, 196 {want: "410ca32e", setup: func(i *instruction) { 197 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 198 }}, 199 {want: "410ca36e", setup: func(i *instruction) { 200 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 201 }}, 202 {want: "410ce36e", setup: func(i *instruction) { 203 i.asVecRRR(vecOpUqadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 204 }}, 205 {want: "412c230e", setup: func(i *instruction) { 206 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 207 }}, 208 {want: "412c234e", setup: func(i *instruction) { 209 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 210 }}, 211 {want: "412c630e", setup: func(i *instruction) { 212 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 213 }}, 214 {want: "412c634e", setup: func(i *instruction) { 215 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 216 }}, 217 {want: "412ca30e", setup: func(i *instruction) { 218 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 219 }}, 220 {want: "412ca34e", setup: func(i *instruction) { 221 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 222 }}, 223 {want: "412ce34e", setup: func(i *instruction) { 224 i.asVecRRR(vecOpSqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 225 }}, 226 {want: "412c232e", setup: func(i *instruction) { 227 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 228 }}, 229 {want: "412c236e", setup: func(i *instruction) { 230 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 231 }}, 232 {want: "412c632e", setup: func(i *instruction) { 233 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 234 }}, 235 {want: "412c636e", setup: func(i *instruction) { 236 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 237 }}, 238 {want: "412ca32e", setup: func(i *instruction) { 239 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 240 }}, 241 {want: "412ca36e", setup: func(i *instruction) { 242 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 243 }}, 244 {want: "412ce36e", setup: func(i *instruction) { 245 i.asVecRRR(vecOpUqsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 246 }}, 247 {want: "4184232e", setup: func(i *instruction) { 248 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 249 }}, 250 {want: "4184236e", setup: func(i *instruction) { 251 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 252 }}, 253 {want: "4184632e", setup: func(i *instruction) { 254 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 255 }}, 256 {want: "4184636e", setup: func(i *instruction) { 257 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 258 }}, 259 {want: "4184a32e", setup: func(i *instruction) { 260 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 261 }}, 262 {want: "4184a36e", setup: func(i *instruction) { 263 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 264 }}, 265 {want: "4184e36e", setup: func(i *instruction) { 266 i.asVecRRR(vecOpSub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 267 }}, 268 {want: "41bc230e", setup: func(i *instruction) { 269 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 270 }}, 271 {want: "41bc234e", setup: func(i *instruction) { 272 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 273 }}, 274 {want: "41bc630e", setup: func(i *instruction) { 275 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 276 }}, 277 {want: "41bc634e", setup: func(i *instruction) { 278 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 279 }}, 280 {want: "41bca30e", setup: func(i *instruction) { 281 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 282 }}, 283 {want: "41bca34e", setup: func(i *instruction) { 284 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 285 }}, 286 {want: "41bce34e", setup: func(i *instruction) { 287 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 288 }}, 289 {want: "41bc230e", setup: func(i *instruction) { 290 i.asVecRRR(vecOpAddp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 291 }}, 292 {want: "41b8314e", setup: func(i *instruction) { 293 i.asVecLanes(vecOpAddv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 294 }}, 295 {want: "41b8710e", setup: func(i *instruction) { 296 i.asVecLanes(vecOpAddv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 297 }}, 298 {want: "41b8714e", setup: func(i *instruction) { 299 i.asVecLanes(vecOpAddv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 300 }}, 301 {want: "41b8b14e", setup: func(i *instruction) { 302 i.asVecLanes(vecOpAddv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 303 }}, 304 {want: "416c230e", setup: func(i *instruction) { 305 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 306 }}, 307 {want: "416c234e", setup: func(i *instruction) { 308 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 309 }}, 310 {want: "416c630e", setup: func(i *instruction) { 311 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 312 }}, 313 {want: "416c634e", setup: func(i *instruction) { 314 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 315 }}, 316 {want: "416ca30e", setup: func(i *instruction) { 317 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 318 }}, 319 {want: "416ca34e", setup: func(i *instruction) { 320 i.asVecRRR(vecOpSmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 321 }}, 322 {want: "416c232e", setup: func(i *instruction) { 323 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 324 }}, 325 {want: "416c236e", setup: func(i *instruction) { 326 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 327 }}, 328 {want: "416c632e", setup: func(i *instruction) { 329 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 330 }}, 331 {want: "416c636e", setup: func(i *instruction) { 332 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 333 }}, 334 {want: "416ca32e", setup: func(i *instruction) { 335 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 336 }}, 337 {want: "416ca36e", setup: func(i *instruction) { 338 i.asVecRRR(vecOpUmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 339 }}, 340 {want: "4164230e", setup: func(i *instruction) { 341 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 342 }}, 343 {want: "4164234e", setup: func(i *instruction) { 344 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 345 }}, 346 {want: "4164630e", setup: func(i *instruction) { 347 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 348 }}, 349 {want: "4164634e", setup: func(i *instruction) { 350 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 351 }}, 352 {want: "4164a30e", setup: func(i *instruction) { 353 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 354 }}, 355 {want: "4164a34e", setup: func(i *instruction) { 356 i.asVecRRR(vecOpSmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 357 }}, 358 {want: "4164232e", setup: func(i *instruction) { 359 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 360 }}, 361 {want: "4164236e", setup: func(i *instruction) { 362 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 363 }}, 364 {want: "4164632e", setup: func(i *instruction) { 365 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 366 }}, 367 {want: "4164636e", setup: func(i *instruction) { 368 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 369 }}, 370 {want: "4164a32e", setup: func(i *instruction) { 371 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 372 }}, 373 {want: "4164a36e", setup: func(i *instruction) { 374 i.asVecRRR(vecOpUmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 375 }}, 376 {want: "41a4232e", setup: func(i *instruction) { 377 i.asVecRRR(vecOpUmaxp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 378 }}, 379 {want: "41a4236e", setup: func(i *instruction) { 380 i.asVecRRR(vecOpUmaxp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 381 }}, 382 {want: "41a4632e", setup: func(i *instruction) { 383 i.asVecRRR(vecOpUmaxp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 384 }}, 385 {want: "41a4636e", setup: func(i *instruction) { 386 i.asVecRRR(vecOpUmaxp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 387 }}, 388 {want: "41a4a32e", setup: func(i *instruction) { 389 i.asVecRRR(vecOpUmaxp, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 390 }}, 391 {want: "41a8312e", setup: func(i *instruction) { 392 i.asVecLanes(vecOpUminv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 393 }}, 394 {want: "41a8316e", setup: func(i *instruction) { 395 i.asVecLanes(vecOpUminv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 396 }}, 397 {want: "41a8712e", setup: func(i *instruction) { 398 i.asVecLanes(vecOpUminv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 399 }}, 400 {want: "41a8716e", setup: func(i *instruction) { 401 i.asVecLanes(vecOpUminv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 402 }}, 403 {want: "41a8b16e", setup: func(i *instruction) { 404 i.asVecLanes(vecOpUminv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 405 }}, 406 {want: "4114232e", setup: func(i *instruction) { 407 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 408 }}, 409 {want: "4114236e", setup: func(i *instruction) { 410 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 411 }}, 412 {want: "4114632e", setup: func(i *instruction) { 413 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 414 }}, 415 {want: "4114636e", setup: func(i *instruction) { 416 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 417 }}, 418 {want: "4114a32e", setup: func(i *instruction) { 419 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 420 }}, 421 {want: "4114a36e", setup: func(i *instruction) { 422 i.asVecRRR(vecOpUrhadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 423 }}, 424 {want: "419c230e", setup: func(i *instruction) { 425 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 426 }}, 427 {want: "419c234e", setup: func(i *instruction) { 428 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 429 }}, 430 {want: "419c630e", setup: func(i *instruction) { 431 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 432 }}, 433 {want: "419c634e", setup: func(i *instruction) { 434 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 435 }}, 436 {want: "419ca30e", setup: func(i *instruction) { 437 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 438 }}, 439 {want: "419ca34e", setup: func(i *instruction) { 440 i.asVecRRR(vecOpMul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 441 }}, 442 {want: "4198200e", setup: func(i *instruction) { 443 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 444 }}, 445 {want: "4198204e", setup: func(i *instruction) { 446 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 447 }}, 448 {want: "4198600e", setup: func(i *instruction) { 449 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 450 }}, 451 {want: "4198604e", setup: func(i *instruction) { 452 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 453 }}, 454 {want: "4198a00e", setup: func(i *instruction) { 455 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 456 }}, 457 {want: "4198a04e", setup: func(i *instruction) { 458 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 459 }}, 460 {want: "4198e04e", setup: func(i *instruction) { 461 i.asVecMisc(vecOpCmeq0, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 462 }}, 463 {want: "418c232e", setup: func(i *instruction) { 464 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 465 }}, 466 {want: "418c236e", setup: func(i *instruction) { 467 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 468 }}, 469 {want: "418c632e", setup: func(i *instruction) { 470 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 471 }}, 472 {want: "418c636e", setup: func(i *instruction) { 473 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 474 }}, 475 {want: "418ca32e", setup: func(i *instruction) { 476 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 477 }}, 478 {want: "418ca36e", setup: func(i *instruction) { 479 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 480 }}, 481 {want: "418ce36e", setup: func(i *instruction) { 482 i.asVecRRR(vecOpCmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 483 }}, 484 {want: "4134230e", setup: func(i *instruction) { 485 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 486 }}, 487 {want: "4134234e", setup: func(i *instruction) { 488 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 489 }}, 490 {want: "4134630e", setup: func(i *instruction) { 491 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 492 }}, 493 {want: "4134634e", setup: func(i *instruction) { 494 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 495 }}, 496 {want: "4134a30e", setup: func(i *instruction) { 497 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 498 }}, 499 {want: "4134a34e", setup: func(i *instruction) { 500 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 501 }}, 502 {want: "4134e34e", setup: func(i *instruction) { 503 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 504 }}, 505 {want: "4134232e", setup: func(i *instruction) { 506 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 507 }}, 508 {want: "4134236e", setup: func(i *instruction) { 509 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 510 }}, 511 {want: "4134632e", setup: func(i *instruction) { 512 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 513 }}, 514 {want: "4134636e", setup: func(i *instruction) { 515 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 516 }}, 517 {want: "4134a32e", setup: func(i *instruction) { 518 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 519 }}, 520 {want: "4134a36e", setup: func(i *instruction) { 521 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 522 }}, 523 {want: "4134e36e", setup: func(i *instruction) { 524 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 525 }}, 526 {want: "413c230e", setup: func(i *instruction) { 527 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 528 }}, 529 {want: "413c234e", setup: func(i *instruction) { 530 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 531 }}, 532 {want: "413c630e", setup: func(i *instruction) { 533 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 534 }}, 535 {want: "413c634e", setup: func(i *instruction) { 536 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 537 }}, 538 {want: "413ca30e", setup: func(i *instruction) { 539 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 540 }}, 541 {want: "413ca34e", setup: func(i *instruction) { 542 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 543 }}, 544 {want: "413ce34e", setup: func(i *instruction) { 545 i.asVecRRR(vecOpCmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 546 }}, 547 {want: "4134230e", setup: func(i *instruction) { 548 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 549 }}, 550 {want: "4134234e", setup: func(i *instruction) { 551 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 552 }}, 553 {want: "4134630e", setup: func(i *instruction) { 554 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 555 }}, 556 {want: "4134634e", setup: func(i *instruction) { 557 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 558 }}, 559 {want: "4134a30e", setup: func(i *instruction) { 560 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 561 }}, 562 {want: "4134a34e", setup: func(i *instruction) { 563 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 564 }}, 565 {want: "4134e34e", setup: func(i *instruction) { 566 i.asVecRRR(vecOpCmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 567 }}, 568 {want: "4134232e", setup: func(i *instruction) { 569 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 570 }}, 571 {want: "4134236e", setup: func(i *instruction) { 572 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 573 }}, 574 {want: "4134632e", setup: func(i *instruction) { 575 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 576 }}, 577 {want: "4134636e", setup: func(i *instruction) { 578 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 579 }}, 580 {want: "4134a32e", setup: func(i *instruction) { 581 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 582 }}, 583 {want: "4134a36e", setup: func(i *instruction) { 584 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 585 }}, 586 {want: "4134e36e", setup: func(i *instruction) { 587 i.asVecRRR(vecOpCmhi, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 588 }}, 589 {want: "413c232e", setup: func(i *instruction) { 590 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 591 }}, 592 {want: "413c236e", setup: func(i *instruction) { 593 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 594 }}, 595 {want: "413c632e", setup: func(i *instruction) { 596 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 597 }}, 598 {want: "413c636e", setup: func(i *instruction) { 599 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 600 }}, 601 {want: "413ca32e", setup: func(i *instruction) { 602 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 603 }}, 604 {want: "413ca36e", setup: func(i *instruction) { 605 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 606 }}, 607 {want: "413ce36e", setup: func(i *instruction) { 608 i.asVecRRR(vecOpCmhs, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 609 }}, 610 {want: "41f4230e", setup: func(i *instruction) { 611 i.asVecRRR(vecOpFmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 612 }}, 613 {want: "41f4234e", setup: func(i *instruction) { 614 i.asVecRRR(vecOpFmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 615 }}, 616 {want: "41f4634e", setup: func(i *instruction) { 617 i.asVecRRR(vecOpFmax, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 618 }}, 619 {want: "41f4a30e", setup: func(i *instruction) { 620 i.asVecRRR(vecOpFmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 621 }}, 622 {want: "41f4a34e", setup: func(i *instruction) { 623 i.asVecRRR(vecOpFmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 624 }}, 625 {want: "41f4e34e", setup: func(i *instruction) { 626 i.asVecRRR(vecOpFmin, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 627 }}, 628 {want: "41d4230e", setup: func(i *instruction) { 629 i.asVecRRR(vecOpFadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 630 }}, 631 {want: "41d4234e", setup: func(i *instruction) { 632 i.asVecRRR(vecOpFadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 633 }}, 634 {want: "41d4634e", setup: func(i *instruction) { 635 i.asVecRRR(vecOpFadd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 636 }}, 637 {want: "41d4a30e", setup: func(i *instruction) { 638 i.asVecRRR(vecOpFsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 639 }}, 640 {want: "41d4a34e", setup: func(i *instruction) { 641 i.asVecRRR(vecOpFsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 642 }}, 643 {want: "41d4e34e", setup: func(i *instruction) { 644 i.asVecRRR(vecOpFsub, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 645 }}, 646 {want: "41dc232e", setup: func(i *instruction) { 647 i.asVecRRR(vecOpFmul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 648 }}, 649 {want: "41dc236e", setup: func(i *instruction) { 650 i.asVecRRR(vecOpFmul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 651 }}, 652 {want: "41dc636e", setup: func(i *instruction) { 653 i.asVecRRR(vecOpFmul, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 654 }}, 655 {want: "41b4636e", setup: func(i *instruction) { 656 i.asVecRRR(vecOpSqrdmulh, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 657 }}, 658 {want: "41b4632e", setup: func(i *instruction) { 659 i.asVecRRR(vecOpSqrdmulh, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 660 }}, 661 {want: "41b4a32e", setup: func(i *instruction) { 662 i.asVecRRR(vecOpSqrdmulh, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 663 }}, 664 {want: "41b4a36e", setup: func(i *instruction) { 665 i.asVecRRR(vecOpSqrdmulh, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 666 }}, 667 {want: "41fc232e", setup: func(i *instruction) { 668 i.asVecRRR(vecOpFdiv, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 669 }}, 670 {want: "41fc236e", setup: func(i *instruction) { 671 i.asVecRRR(vecOpFdiv, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 672 }}, 673 {want: "41fc636e", setup: func(i *instruction) { 674 i.asVecRRR(vecOpFdiv, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 675 }}, 676 {want: "41e4230e", setup: func(i *instruction) { 677 i.asVecRRR(vecOpFcmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 678 }}, 679 {want: "41e4234e", setup: func(i *instruction) { 680 i.asVecRRR(vecOpFcmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 681 }}, 682 {want: "41e4634e", setup: func(i *instruction) { 683 i.asVecRRR(vecOpFcmeq, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 684 }}, 685 {want: "41e4a32e", setup: func(i *instruction) { 686 i.asVecRRR(vecOpFcmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 687 }}, 688 {want: "41e4a36e", setup: func(i *instruction) { 689 i.asVecRRR(vecOpFcmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 690 }}, 691 {want: "41e4e36e", setup: func(i *instruction) { 692 i.asVecRRR(vecOpFcmgt, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 693 }}, 694 {want: "41e4232e", setup: func(i *instruction) { 695 i.asVecRRR(vecOpFcmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 696 }}, 697 {want: "41e4236e", setup: func(i *instruction) { 698 i.asVecRRR(vecOpFcmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 699 }}, 700 {want: "41e4636e", setup: func(i *instruction) { 701 i.asVecRRR(vecOpFcmge, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 702 }}, 703 {want: "4198210e", setup: func(i *instruction) { 704 i.asVecMisc(vecOpFrintm, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 705 }}, 706 {want: "4198214e", setup: func(i *instruction) { 707 i.asVecMisc(vecOpFrintm, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 708 }}, 709 {want: "4198614e", setup: func(i *instruction) { 710 i.asVecMisc(vecOpFrintm, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 711 }}, 712 {want: "4188210e", setup: func(i *instruction) { 713 i.asVecMisc(vecOpFrintn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 714 }}, 715 {want: "4188214e", setup: func(i *instruction) { 716 i.asVecMisc(vecOpFrintn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 717 }}, 718 {want: "4188614e", setup: func(i *instruction) { 719 i.asVecMisc(vecOpFrintn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 720 }}, 721 {want: "4188a10e", setup: func(i *instruction) { 722 i.asVecMisc(vecOpFrintp, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 723 }}, 724 {want: "4188a14e", setup: func(i *instruction) { 725 i.asVecMisc(vecOpFrintp, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 726 }}, 727 {want: "4188e14e", setup: func(i *instruction) { 728 i.asVecMisc(vecOpFrintp, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 729 }}, 730 {want: "4198a10e", setup: func(i *instruction) { 731 i.asVecMisc(vecOpFrintz, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 732 }}, 733 {want: "4198a14e", setup: func(i *instruction) { 734 i.asVecMisc(vecOpFrintz, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 735 }}, 736 {want: "4198e14e", setup: func(i *instruction) { 737 i.asVecMisc(vecOpFrintz, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 738 }}, 739 {want: "4178610e", setup: func(i *instruction) { 740 i.asVecMisc(vecOpFcvtl, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 741 }}, 742 {want: "4178210e", setup: func(i *instruction) { 743 i.asVecMisc(vecOpFcvtl, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 744 }}, 745 {want: "4168610e", setup: func(i *instruction) { 746 i.asVecMisc(vecOpFcvtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 747 }}, 748 {want: "4168210e", setup: func(i *instruction) { 749 i.asVecMisc(vecOpFcvtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 750 }}, 751 {want: "41b8a10e", setup: func(i *instruction) { 752 i.asVecMisc(vecOpFcvtzs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 753 }}, 754 {want: "41b8a14e", setup: func(i *instruction) { 755 i.asVecMisc(vecOpFcvtzs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 756 }}, 757 {want: "41b8e14e", setup: func(i *instruction) { 758 i.asVecMisc(vecOpFcvtzs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 759 }}, 760 {want: "41b8a12e", setup: func(i *instruction) { 761 i.asVecMisc(vecOpFcvtzu, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 762 }}, 763 {want: "41b8a16e", setup: func(i *instruction) { 764 i.asVecMisc(vecOpFcvtzu, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 765 }}, 766 {want: "41b8e16e", setup: func(i *instruction) { 767 i.asVecMisc(vecOpFcvtzu, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 768 }}, 769 {want: "41d8210e", setup: func(i *instruction) { 770 i.asVecMisc(vecOpScvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 771 }}, 772 {want: "41d8214e", setup: func(i *instruction) { 773 i.asVecMisc(vecOpScvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 774 }}, 775 {want: "41d8614e", setup: func(i *instruction) { 776 i.asVecMisc(vecOpScvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 777 }}, 778 {want: "41d8212e", setup: func(i *instruction) { 779 i.asVecMisc(vecOpUcvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 780 }}, 781 {want: "41d8216e", setup: func(i *instruction) { 782 i.asVecMisc(vecOpUcvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 783 }}, 784 {want: "41d8616e", setup: func(i *instruction) { 785 i.asVecMisc(vecOpUcvtf, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 786 }}, 787 {want: "4148210e", setup: func(i *instruction) { 788 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 789 }}, 790 {want: "4148214e", setup: func(i *instruction) { // sqxtn2 791 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 792 }}, 793 {want: "4148610e", setup: func(i *instruction) { 794 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 795 }}, 796 {want: "4148614e", setup: func(i *instruction) { // sqxtn2 797 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 798 }}, 799 {want: "4148a10e", setup: func(i *instruction) { 800 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 801 }}, 802 {want: "4148a14e", setup: func(i *instruction) { // sqxtun2 803 i.asVecMisc(vecOpSqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 804 }}, 805 {want: "4128212e", setup: func(i *instruction) { 806 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 807 }}, 808 {want: "4128216e", setup: func(i *instruction) { // uqxtun2 809 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 810 }}, 811 {want: "4128612e", setup: func(i *instruction) { 812 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 813 }}, 814 {want: "4128616e", setup: func(i *instruction) { // sqxtun2 815 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 816 }}, 817 {want: "4128a12e", setup: func(i *instruction) { 818 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 819 }}, 820 {want: "4128a16e", setup: func(i *instruction) { // sqxtun2 821 i.asVecMisc(vecOpSqxtun, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 822 }}, 823 {want: "4148212e", setup: func(i *instruction) { 824 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 825 }}, 826 {want: "4148216e", setup: func(i *instruction) { // uqxtn2 827 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 828 }}, 829 {want: "4148612e", setup: func(i *instruction) { 830 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 831 }}, 832 {want: "4148616e", setup: func(i *instruction) { // sqxtn2 833 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 834 }}, 835 {want: "4148a12e", setup: func(i *instruction) { 836 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 837 }}, 838 {want: "4148a16e", setup: func(i *instruction) { // sqxtn2 839 i.asVecMisc(vecOpUqxtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 840 }}, 841 {want: "41b8200e", setup: func(i *instruction) { 842 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 843 }}, 844 {want: "41b8204e", setup: func(i *instruction) { 845 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 846 }}, 847 {want: "41b8600e", setup: func(i *instruction) { 848 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 849 }}, 850 {want: "41b8604e", setup: func(i *instruction) { 851 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 852 }}, 853 {want: "41b8a00e", setup: func(i *instruction) { 854 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 855 }}, 856 {want: "41b8a04e", setup: func(i *instruction) { 857 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 858 }}, 859 {want: "41b8e04e", setup: func(i *instruction) { 860 i.asVecMisc(vecOpAbs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 861 }}, 862 {want: "41f8a00e", setup: func(i *instruction) { 863 i.asVecMisc(vecOpFabs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 864 }}, 865 {want: "41f8a04e", setup: func(i *instruction) { 866 i.asVecMisc(vecOpFabs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 867 }}, 868 {want: "41f8e04e", setup: func(i *instruction) { 869 i.asVecMisc(vecOpFabs, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 870 }}, 871 {want: "41b8202e", setup: func(i *instruction) { 872 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 873 }}, 874 {want: "41b8206e", setup: func(i *instruction) { 875 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 876 }}, 877 {want: "41b8602e", setup: func(i *instruction) { 878 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 879 }}, 880 {want: "41b8606e", setup: func(i *instruction) { 881 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 882 }}, 883 {want: "41b8a02e", setup: func(i *instruction) { 884 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 885 }}, 886 {want: "41b8a06e", setup: func(i *instruction) { 887 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 888 }}, 889 {want: "41b8e06e", setup: func(i *instruction) { 890 i.asVecMisc(vecOpNeg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 891 }}, 892 {want: "4128a10e", setup: func(i *instruction) { 893 i.asVecMisc(vecOpXtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 894 }}, 895 {want: "4128a10e", setup: func(i *instruction) { 896 i.asVecMisc(vecOpXtn, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 897 }}, 898 {want: "41f8a02e", setup: func(i *instruction) { 899 i.asVecMisc(vecOpFneg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 900 }}, 901 {want: "41f8a06e", setup: func(i *instruction) { 902 i.asVecMisc(vecOpFneg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 903 }}, 904 {want: "41f8e06e", setup: func(i *instruction) { 905 i.asVecMisc(vecOpFneg, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 906 }}, 907 {want: "41f8a12e", setup: func(i *instruction) { 908 i.asVecMisc(vecOpFsqrt, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2S) 909 }}, 910 {want: "41f8a16e", setup: func(i *instruction) { 911 i.asVecMisc(vecOpFsqrt, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 912 }}, 913 {want: "41f8e16e", setup: func(i *instruction) { 914 i.asVecMisc(vecOpFsqrt, operandNR(v1VReg), operandNR(v2VReg), vecArrangement2D) 915 }}, 916 {want: "4100839a", setup: func(i *instruction) { i.asCSel(operandNR(x1VReg), operandNR(x2VReg), operandNR(x3VReg), eq, true) }}, 917 {want: "4110839a", setup: func(i *instruction) { i.asCSel(operandNR(x1VReg), operandNR(x2VReg), operandNR(x3VReg), ne, true) }}, 918 {want: "4100831a", setup: func(i *instruction) { i.asCSel(operandNR(x1VReg), operandNR(x2VReg), operandNR(x3VReg), eq, false) }}, 919 {want: "4110831a", setup: func(i *instruction) { i.asCSel(operandNR(x1VReg), operandNR(x2VReg), operandNR(x3VReg), ne, false) }}, 920 {want: "41cc631e", setup: func(i *instruction) { i.asFpuCSel(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), gt, true) }}, 921 {want: "41bc631e", setup: func(i *instruction) { i.asFpuCSel(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), lt, true) }}, 922 {want: "41cc231e", setup: func(i *instruction) { i.asFpuCSel(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), gt, false) }}, 923 {want: "41bc231e", setup: func(i *instruction) { i.asFpuCSel(operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), lt, false) }}, 924 {want: "411c014e", setup: func(i *instruction) { i.asMovToVec(operandNR(v1VReg), operandNR(x2VReg), vecArrangementB, 0) }}, 925 {want: "411c024e", setup: func(i *instruction) { i.asMovToVec(operandNR(v1VReg), operandNR(x2VReg), vecArrangementH, 0) }}, 926 {want: "411c044e", setup: func(i *instruction) { i.asMovToVec(operandNR(v1VReg), operandNR(x2VReg), vecArrangementS, 0) }}, 927 {want: "411c084e", setup: func(i *instruction) { i.asMovToVec(operandNR(v1VReg), operandNR(x2VReg), vecArrangementD, 0) }}, 928 {want: "413c010e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementB, 0, false) }}, 929 {want: "413c020e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementH, 0, false) }}, 930 {want: "413c040e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementS, 0, false) }}, 931 {want: "413c084e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementD, 0, false) }}, 932 {want: "412c030e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementB, 1, true) }}, 933 {want: "412c060e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementH, 1, true) }}, 934 {want: "412c0c4e", setup: func(i *instruction) { i.asMovFromVec(operandNR(x1VReg), operandNR(v2VReg), vecArrangementS, 1, true) }}, 935 {want: "410c084e", setup: func(i *instruction) { i.asVecDup(operandNR(x1VReg), operandNR(v2VReg), vecArrangement2D) }}, 936 {want: "4140036e", setup: func(i *instruction) { // 4140036e 937 i.asVecExtract(operandNR(x1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B, 8) 938 }}, 939 {want: "4138034e", setup: func(i *instruction) { 940 i.asVecPermute(vecOpZip1, operandNR(x1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 941 }}, 942 {want: "4104214f", setup: func(i *instruction) { 943 i.asVecShiftImm(vecOpSshr, operandNR(x1VReg), operandNR(x2VReg), operandShiftImm(31), vecArrangement4S) 944 }}, 945 {want: "5b28030b", setup: func(i *instruction) { 946 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false) 947 }}, 948 {want: "5b28038b", setup: func(i *instruction) { 949 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true) 950 }}, 951 {want: "5b28032b", setup: func(i *instruction) { 952 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false) 953 }}, 954 {want: "5b2803ab", setup: func(i *instruction) { 955 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true) 956 }}, 957 {want: "5b28430b", setup: func(i *instruction) { 958 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false) 959 }}, 960 {want: "5b28438b", setup: func(i *instruction) { 961 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true) 962 }}, 963 {want: "5b28432b", setup: func(i *instruction) { 964 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false) 965 }}, 966 {want: "5b2843ab", setup: func(i *instruction) { 967 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true) 968 }}, 969 {want: "5b28830b", setup: func(i *instruction) { 970 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false) 971 }}, 972 {want: "5b28838b", setup: func(i *instruction) { 973 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true) 974 }}, 975 {want: "5b28832b", setup: func(i *instruction) { 976 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false) 977 }}, 978 {want: "5b2883ab", setup: func(i *instruction) { 979 i.asALU(aluOpAddS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true) 980 }}, 981 {want: "5b28034b", setup: func(i *instruction) { 982 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false) 983 }}, 984 {want: "5b2803cb", setup: func(i *instruction) { 985 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true) 986 }}, 987 {want: "5b28036b", setup: func(i *instruction) { 988 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), false) 989 }}, 990 {want: "5b2803eb", setup: func(i *instruction) { 991 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSL), true) 992 }}, 993 {want: "5b28434b", setup: func(i *instruction) { 994 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false) 995 }}, 996 {want: "5b2843cb", setup: func(i *instruction) { 997 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true) 998 }}, 999 {want: "5b28436b", setup: func(i *instruction) { 1000 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), false) 1001 }}, 1002 {want: "5b2843eb", setup: func(i *instruction) { 1003 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpLSR), true) 1004 }}, 1005 {want: "5b28834b", setup: func(i *instruction) { 1006 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false) 1007 }}, 1008 {want: "5b2883cb", setup: func(i *instruction) { 1009 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true) 1010 }}, 1011 {want: "5b28836b", setup: func(i *instruction) { 1012 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), false) 1013 }}, 1014 {want: "5b2883eb", setup: func(i *instruction) { 1015 i.asALU(aluOpSubS, operandNR(tmpRegVReg), operandNR(x2VReg), operandSR(x3VReg, 10, shiftOpASR), true) 1016 }}, 1017 {want: "60033fd6", setup: func(i *instruction) { 1018 i.asCallIndirect(tmpRegVReg, nil) 1019 }}, 1020 {want: "fb633bcb", setup: func(i *instruction) { 1021 i.asALU(aluOpSub, operandNR(tmpRegVReg), operandNR(spVReg), operandNR(tmpRegVReg), true) 1022 }}, 1023 {want: "fb633b8b", setup: func(i *instruction) { 1024 i.asALU(aluOpAdd, operandNR(tmpRegVReg), operandNR(spVReg), operandNR(tmpRegVReg), true) 1025 }}, 1026 {want: "2000020a", setup: func(i *instruction) { 1027 i.asALU(aluOpAnd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1028 }}, 1029 {want: "2000028a", setup: func(i *instruction) { 1030 i.asALU(aluOpAnd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1031 }}, 1032 {want: "2010028a", setup: func(i *instruction) { 1033 i.asALU(aluOpAnd, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true) 1034 }}, 1035 {want: "2030428a", setup: func(i *instruction) { 1036 i.asALU(aluOpAnd, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 12, shiftOpLSR), true) 1037 }}, 1038 {want: "2000026a", setup: func(i *instruction) { 1039 i.asALU(aluOpAnds, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1040 }}, 1041 {want: "200002ea", setup: func(i *instruction) { 1042 i.asALU(aluOpAnds, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1043 }}, 1044 {want: "201002ea", setup: func(i *instruction) { 1045 i.asALU(aluOpAnds, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true) 1046 }}, 1047 {want: "203042ea", setup: func(i *instruction) { 1048 i.asALU(aluOpAnds, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 12, shiftOpLSR), true) 1049 }}, 1050 {want: "2000022a", setup: func(i *instruction) { 1051 i.asALU(aluOpOrr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1052 }}, 1053 {want: "200002aa", setup: func(i *instruction) { 1054 i.asALU(aluOpOrr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1055 }}, 1056 {want: "201002aa", setup: func(i *instruction) { 1057 i.asALU(aluOpOrr, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true) 1058 }}, 1059 {want: "201082aa", setup: func(i *instruction) { 1060 i.asALU(aluOpOrr, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpASR), true) 1061 }}, 1062 {want: "2000024a", setup: func(i *instruction) { 1063 i.asALU(aluOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1064 }}, 1065 {want: "200002ca", setup: func(i *instruction) { 1066 i.asALU(aluOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1067 }}, 1068 {want: "201002ca", setup: func(i *instruction) { 1069 i.asALU(aluOpEor, operandNR(x0VReg), operandNR(x1VReg), operandSR(x2VReg, 4, shiftOpLSL), true) 1070 }}, 1071 {want: "202cc21a", setup: func(i *instruction) { 1072 i.asALU(aluOpRotR, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1073 }}, 1074 {want: "202cc29a", setup: func(i *instruction) { 1075 i.asALU(aluOpRotR, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1076 }}, 1077 {want: "2000222a", setup: func(i *instruction) { 1078 i.asALU(aluOpOrn, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), false) 1079 }}, 1080 {want: "200022aa", setup: func(i *instruction) { 1081 i.asALU(aluOpOrn, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), true) 1082 }}, 1083 {want: "30000010", setup: func(i *instruction) { i.asAdr(v16VReg, 4) }}, 1084 {want: "50050030", setup: func(i *instruction) { i.asAdr(v16VReg, 169) }}, 1085 {want: "101e302e", setup: func(i *instruction) { i.asLoadFpuConst32(v16VReg, uint64(math.Float32bits(0))) }}, 1086 {want: "5000001c020000140000803f", setup: func(i *instruction) { 1087 i.asLoadFpuConst32(v16VReg, uint64(math.Float32bits(1.0))) 1088 }}, 1089 {want: "101e302e", setup: func(i *instruction) { i.asLoadFpuConst64(v16VReg, uint64(math.Float32bits(0))) }}, 1090 {want: "5000005c03000014000000000000f03f", setup: func(i *instruction) { 1091 i.asLoadFpuConst64(v16VReg, math.Float64bits(1.0)) 1092 }}, 1093 {want: "101e306e", setup: func(i *instruction) { i.asLoadFpuConst128(v16VReg, 0, 0) }}, 1094 {want: "5000009c05000014ffffffffffffffffaaaaaaaaaaaaaaaa", setup: func(i *instruction) { i.asLoadFpuConst128(v16VReg, 0xffffffff_ffffffff, 0xaaaaaaaa_aaaaaaaa) }}, 1095 {want: "8220061b", setup: func(i *instruction) { 1096 i.asALURRRR(aluOpMAdd, operandNR(x2VReg), operandNR(x4VReg), operandNR(x6VReg), operandNR(x8VReg), false) 1097 }}, 1098 {want: "8220069b", setup: func(i *instruction) { 1099 i.asALURRRR(aluOpMAdd, operandNR(x2VReg), operandNR(x4VReg), operandNR(x6VReg), operandNR(x8VReg), true) 1100 }}, 1101 {want: "82a0061b", setup: func(i *instruction) { 1102 i.asALURRRR(aluOpMSub, operandNR(x2VReg), operandNR(x4VReg), operandNR(x6VReg), operandNR(x8VReg), false) 1103 }}, 1104 {want: "82a0069b", setup: func(i *instruction) { 1105 i.asALURRRR(aluOpMSub, operandNR(x2VReg), operandNR(x4VReg), operandNR(x6VReg), operandNR(x8VReg), true) 1106 }}, 1107 {want: "00213f1e", setup: func(i *instruction) { i.asFpuCmp(operandNR(v8VReg), operandNR(v31VReg), false) }}, 1108 {want: "00217f1e", setup: func(i *instruction) { i.asFpuCmp(operandNR(v8VReg), operandNR(v31VReg), true) }}, 1109 {want: "b21c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 32, false) }}, 1110 {want: "b23c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 32, false) }}, 1111 {want: "b21c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 64, false) }}, 1112 {want: "b23c0053", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 64, false) }}, 1113 {want: "f203052a", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 32, 64, false) }}, 1114 {want: "b21c0013", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 32, true) }}, 1115 {want: "b23c0013", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 32, true) }}, 1116 {want: "b21c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 8, 64, true) }}, 1117 {want: "b23c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 16, 64, true) }}, 1118 {want: "b27c4093", setup: func(i *instruction) { i.asExtend(x18VReg, x5VReg, 32, 64, true) }}, 1119 {want: "f2079f9a", setup: func(i *instruction) { i.asCSet(x18VReg, false, ne) }}, 1120 {want: "f2179f9a", setup: func(i *instruction) { i.asCSet(x18VReg, false, eq) }}, 1121 {want: "e0039fda", setup: func(i *instruction) { i.asCSet(x0VReg, true, ne) }}, 1122 {want: "f2139fda", setup: func(i *instruction) { i.asCSet(x18VReg, true, eq) }}, 1123 {want: "32008012", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 0, false) }}, 1124 {want: "52559512", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 0, false) }}, 1125 {want: "f2ff9f12", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 0, false) }}, 1126 {want: "3200a012", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 1, false) }}, 1127 {want: "5255b512", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 1, false) }}, 1128 {want: "f2ffbf12", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 1, false) }}, 1129 {want: "32008092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 0, true) }}, 1130 {want: "52559592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 0, true) }}, 1131 {want: "f2ff9f92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 0, true) }}, 1132 {want: "3200a092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 1, true) }}, 1133 {want: "5255b592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 1, true) }}, 1134 {want: "f2ffbf92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 1, true) }}, 1135 {want: "3200c092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 2, true) }}, 1136 {want: "5255d592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 2, true) }}, 1137 {want: "f2ffdf92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 2, true) }}, 1138 {want: "3200e092", setup: func(i *instruction) { i.asMOVN(x18VReg, 1, 3, true) }}, 1139 {want: "5255f592", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xaaaa, 3, true) }}, 1140 {want: "f2ffff92", setup: func(i *instruction) { i.asMOVN(x18VReg, 0xffff, 3, true) }}, 1141 {want: "5255b572", setup: func(i *instruction) { i.asMOVK(x18VReg, 0xaaaa, 1, false) }}, 1142 {want: "5255f5f2", setup: func(i *instruction) { i.asMOVK(x18VReg, 0xaaaa, 3, true) }}, 1143 {want: "5255b552", setup: func(i *instruction) { i.asMOVZ(x18VReg, 0xaaaa, 1, false) }}, 1144 {want: "5255f5d2", setup: func(i *instruction) { i.asMOVZ(x18VReg, 0xaaaa, 3, true) }}, 1145 {want: "4f020012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1, false) }}, 1146 {want: "4f0a0012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7, false) }}, 1147 {want: "4f0e0012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xf, false) }}, 1148 {want: "4f120012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1f, false) }}, 1149 {want: "4f160012", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3f, false) }}, 1150 {want: "4f021112", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x8000, false) }}, 1151 {want: "4f721f12", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3ffffffe, false) }}, 1152 {want: "4f7a1f12", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffffffe, false) }}, 1153 {want: "4f024092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1, true) }}, 1154 {want: "4f0a4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7, true) }}, 1155 {want: "4f0e4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xf, true) }}, 1156 {want: "4f124092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x1f, true) }}, 1157 {want: "4f164092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x3f, true) }}, 1158 {want: "4f4e4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffff, true) }}, 1159 {want: "4f7e7092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xffffffff0000, true) }}, 1160 {want: "4f7a4092", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7fffffff, true) }}, 1161 {want: "4f767f92", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0x7ffffffe, true) }}, 1162 {want: "4fba7f92", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpAnd, x15VReg, x18VReg, 0xfffffffffffe, true) }}, 1163 {want: "4f020032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1, false) }}, 1164 {want: "4f0a0032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7, false) }}, 1165 {want: "4f0e0032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xf, false) }}, 1166 {want: "4f120032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1f, false) }}, 1167 {want: "4f160032", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3f, false) }}, 1168 {want: "4f021132", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x8000, false) }}, 1169 {want: "4f721f32", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3ffffffe, false) }}, 1170 {want: "4f7a1f32", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffffffe, false) }}, 1171 {want: "4f0240b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1, true) }}, 1172 {want: "4f0a40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7, true) }}, 1173 {want: "4f0e40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xf, true) }}, 1174 {want: "4f1240b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x1f, true) }}, 1175 {want: "4f1640b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x3f, true) }}, 1176 {want: "4f4e40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffff, true) }}, 1177 {want: "4f7e70b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xffffffff0000, true) }}, 1178 {want: "4f7a40b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7fffffff, true) }}, 1179 {want: "4f767fb2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0x7ffffffe, true) }}, 1180 {want: "4fba7fb2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x15VReg, x18VReg, 0xfffffffffffe, true) }}, 1181 {want: "4f020052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1, false) }}, 1182 {want: "4f0a0052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7, false) }}, 1183 {want: "4f0e0052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xf, false) }}, 1184 {want: "4f120052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1f, false) }}, 1185 {want: "4f160052", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3f, false) }}, 1186 {want: "4f021152", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x8000, false) }}, 1187 {want: "4f721f52", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3ffffffe, false) }}, 1188 {want: "4f7a1f52", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffffffe, false) }}, 1189 {want: "4f0240d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1, true) }}, 1190 {want: "4f0a40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7, true) }}, 1191 {want: "4f0e40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xf, true) }}, 1192 {want: "4f1240d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x1f, true) }}, 1193 {want: "4f1640d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x3f, true) }}, 1194 {want: "4f4e40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffff, true) }}, 1195 {want: "4f7e70d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xffffffff0000, true) }}, 1196 {want: "4f7a40d2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7fffffff, true) }}, 1197 {want: "4f767fd2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0x7ffffffe, true) }}, 1198 {want: "4fba7fd2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpEor, x15VReg, x18VReg, 0xfffffffffffe, true) }}, 1199 {want: "f20300b2", setup: func(i *instruction) { i.asALUBitmaskImm(aluOpOrr, x18VReg, xzrVReg, 0x100000001, true) }}, 1200 {want: "f21fbf0e", setup: func(i *instruction) { i.asFpuMov64(v18VReg, v31VReg) }}, 1201 {want: "f21fbf4e", setup: func(i *instruction) { i.asFpuMov128(v18VReg, v31VReg) }}, 1202 {want: "40a034ab", setup: func(i *instruction) { 1203 i.asALU(aluOpAddS, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 64), false) 1204 }}, 1205 {want: "4080348b", setup: func(i *instruction) { 1206 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTB, 64), false) 1207 }}, 1208 {want: "40a0348b", setup: func(i *instruction) { 1209 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 64), false) 1210 }}, 1211 {want: "40c0348b", setup: func(i *instruction) { 1212 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTW, 64), false) 1213 }}, 1214 {want: "4080340b", setup: func(i *instruction) { 1215 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTB, 32), false) 1216 }}, 1217 {want: "40a0340b", setup: func(i *instruction) { 1218 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTH, 32), false) 1219 }}, 1220 {want: "40c0340b", setup: func(i *instruction) { 1221 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpSXTW, 32), false) 1222 }}, 1223 {want: "400034eb", setup: func(i *instruction) { 1224 i.asALU(aluOpSubS, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 64), false) 1225 }}, 1226 {want: "400034cb", setup: func(i *instruction) { 1227 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 64), false) 1228 }}, 1229 {want: "402034cb", setup: func(i *instruction) { 1230 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTH, 64), false) 1231 }}, 1232 {want: "404034cb", setup: func(i *instruction) { 1233 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTW, 64), false) 1234 }}, 1235 {want: "4000344b", setup: func(i *instruction) { 1236 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTB, 32), false) 1237 }}, 1238 {want: "4020344b", setup: func(i *instruction) { 1239 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTH, 32), false) 1240 }}, 1241 {want: "4040344b", setup: func(i *instruction) { 1242 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandER(x20VReg, extendOpUXTW, 32), false) 1243 }}, 1244 {want: "4000140b", setup: func(i *instruction) { 1245 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1246 }}, 1247 {want: "4000148b", setup: func(i *instruction) { 1248 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1249 }}, 1250 {want: "40001f8b", setup: func(i *instruction) { 1251 i.asALU(aluOpAdd, operandNR(x0VReg), operandNR(x2VReg), operandNR(xzrVReg), true) 1252 }}, 1253 {want: "4000142b", setup: func(i *instruction) { 1254 i.asALU(aluOpAddS, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1255 }}, 1256 {want: "400014ab", setup: func(i *instruction) { 1257 i.asALU(aluOpAddS, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1258 }}, 1259 {want: "4000144b", setup: func(i *instruction) { 1260 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1261 }}, 1262 {want: "400014cb", setup: func(i *instruction) { 1263 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1264 }}, 1265 {want: "40001fcb", setup: func(i *instruction) { 1266 i.asALU(aluOpSub, operandNR(x0VReg), operandNR(x2VReg), operandNR(xzrVReg), true) 1267 }}, 1268 {want: "400014eb", setup: func(i *instruction) { 1269 i.asALU(aluOpSubS, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1270 }}, 1271 {want: "40001feb", setup: func(i *instruction) { 1272 i.asALU(aluOpSubS, operandNR(x0VReg), operandNR(x2VReg), operandNR(xzrVReg), true) 1273 }}, 1274 {want: "c0035fd6", setup: func(i *instruction) { i.asRet() }}, 1275 {want: "e303042a", setup: func(i *instruction) { i.asMove32(x3VReg, x4VReg) }}, 1276 {want: "fe03002a", setup: func(i *instruction) { i.asMove32(x30VReg, x0VReg) }}, 1277 {want: "e30304aa", setup: func(i *instruction) { i.asMove64(x3VReg, x4VReg) }}, 1278 {want: "fe0300aa", setup: func(i *instruction) { i.asMove64(x30VReg, x0VReg) }}, 1279 {want: "9f000091", setup: func(i *instruction) { i.asMove64(spVReg, x4VReg) }}, 1280 {want: "e0030091", setup: func(i *instruction) { i.asMove64(x0VReg, spVReg) }}, 1281 {want: "e17bc1a8", setup: func(i *instruction) { 1282 i.asLoadPair64(x1VReg, x30VReg, addressModePreOrPostIndex(spVReg, 16, false)) 1283 }}, 1284 {want: "e17bc1a9", setup: func(i *instruction) { 1285 i.asLoadPair64(x1VReg, x30VReg, addressModePreOrPostIndex(spVReg, 16, true)) 1286 }}, 1287 {want: "e17b81a8", setup: func(i *instruction) { 1288 i.asStorePair64(x1VReg, x30VReg, addressModePreOrPostIndex(spVReg, 16, false)) 1289 }}, 1290 {want: "e17b81a9", setup: func(i *instruction) { 1291 i.asStorePair64(x1VReg, x30VReg, addressModePreOrPostIndex(spVReg, 16, true)) 1292 }}, 1293 {want: "e17f81a9", setup: func(i *instruction) { 1294 i.asStorePair64(x1VReg, xzrVReg, addressModePreOrPostIndex(spVReg, 16, true)) 1295 }}, 1296 {want: "ff7f81a9", setup: func(i *instruction) { 1297 i.asStorePair64(xzrVReg, xzrVReg, addressModePreOrPostIndex(spVReg, 16, true)) 1298 }}, 1299 {want: "20000014", setup: func(i *instruction) { 1300 i.asBr(dummyLabel) 1301 i.brOffsetResolve(0x80) 1302 }}, 1303 {want: "01040034", setup: func(i *instruction) { 1304 i.asCondBr(registerAsRegZeroCond(x1VReg), dummyLabel, false) 1305 i.condBrOffsetResolve(0x80) 1306 }}, 1307 {want: "010400b4", setup: func(i *instruction) { 1308 i.asCondBr(registerAsRegZeroCond(x1VReg), dummyLabel, true) 1309 i.condBrOffsetResolve(0x80) 1310 }}, 1311 {want: "01040035", setup: func(i *instruction) { 1312 i.asCondBr(registerAsRegNotZeroCond(x1VReg), dummyLabel, false) 1313 i.condBrOffsetResolve(0x80) 1314 }}, 1315 {want: "010400b5", setup: func(i *instruction) { 1316 i.asCondBr(registerAsRegNotZeroCond(x1VReg), dummyLabel, true) 1317 i.condBrOffsetResolve(0x80) 1318 }}, 1319 {want: "8328321e", setup: func(i *instruction) { 1320 i.asFpuRRR(fpuBinOpAdd, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1321 }}, 1322 {want: "8328721e", setup: func(i *instruction) { 1323 i.asFpuRRR(fpuBinOpAdd, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1324 }}, 1325 {want: "8338321e", setup: func(i *instruction) { 1326 i.asFpuRRR(fpuBinOpSub, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1327 }}, 1328 {want: "8338721e", setup: func(i *instruction) { 1329 i.asFpuRRR(fpuBinOpSub, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1330 }}, 1331 {want: "8308321e", setup: func(i *instruction) { 1332 i.asFpuRRR(fpuBinOpMul, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1333 }}, 1334 {want: "8308721e", setup: func(i *instruction) { 1335 i.asFpuRRR(fpuBinOpMul, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1336 }}, 1337 {want: "8318321e", setup: func(i *instruction) { 1338 i.asFpuRRR(fpuBinOpDiv, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1339 }}, 1340 {want: "8318721e", setup: func(i *instruction) { 1341 i.asFpuRRR(fpuBinOpDiv, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1342 }}, 1343 {want: "8348321e", setup: func(i *instruction) { 1344 i.asFpuRRR(fpuBinOpMax, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1345 }}, 1346 {want: "8348721e", setup: func(i *instruction) { 1347 i.asFpuRRR(fpuBinOpMax, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1348 }}, 1349 {want: "8358321e", setup: func(i *instruction) { 1350 i.asFpuRRR(fpuBinOpMin, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), false) 1351 }}, 1352 {want: "8358721e", setup: func(i *instruction) { 1353 i.asFpuRRR(fpuBinOpMin, operandNR(v3VReg), operandNR(v4VReg), operandNR(v18VReg), true) 1354 }}, 1355 {want: "49fd7f11", setup: func(i *instruction) { 1356 i.asALU(aluOpAdd, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false) 1357 }}, 1358 {want: "e9ff7f91", setup: func(i *instruction) { 1359 i.asALU(aluOpAdd, operandNR(x9VReg), operandNR(spVReg), operandImm12(0b111111111111, 0b1), true) 1360 }}, 1361 {want: "49fd3f11", setup: func(i *instruction) { 1362 i.asALU(aluOpAdd, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false) 1363 }}, 1364 {want: "5ffd3f91", setup: func(i *instruction) { 1365 i.asALU(aluOpAdd, operandNR(spVReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true) 1366 }}, 1367 {want: "49fd7f31", setup: func(i *instruction) { 1368 i.asALU(aluOpAddS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false) 1369 }}, 1370 {want: "49fd7fb1", setup: func(i *instruction) { 1371 i.asALU(aluOpAddS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), true) 1372 }}, 1373 {want: "49fd3f31", setup: func(i *instruction) { 1374 i.asALU(aluOpAddS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false) 1375 }}, 1376 {want: "49fd3fb1", setup: func(i *instruction) { 1377 i.asALU(aluOpAddS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true) 1378 }}, 1379 {want: "49fd7f51", setup: func(i *instruction) { 1380 i.asALU(aluOpSub, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false) 1381 }}, 1382 {want: "e9ff7fd1", setup: func(i *instruction) { 1383 i.asALU(aluOpSub, operandNR(x9VReg), operandNR(spVReg), operandImm12(0b111111111111, 0b1), true) 1384 }}, 1385 {want: "49fd3f51", setup: func(i *instruction) { 1386 i.asALU(aluOpSub, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false) 1387 }}, 1388 {want: "5ffd3fd1", setup: func(i *instruction) { 1389 i.asALU(aluOpSub, operandNR(spVReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true) 1390 }}, 1391 {want: "49fd7f71", setup: func(i *instruction) { 1392 i.asALU(aluOpSubS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), false) 1393 }}, 1394 {want: "49fd7ff1", setup: func(i *instruction) { 1395 i.asALU(aluOpSubS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b1), true) 1396 }}, 1397 {want: "49fd3f71", setup: func(i *instruction) { 1398 i.asALU(aluOpSubS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), false) 1399 }}, 1400 {want: "49fd3ff1", setup: func(i *instruction) { 1401 i.asALU(aluOpSubS, operandNR(x9VReg), operandNR(x10VReg), operandImm12(0b111111111111, 0b0), true) 1402 }}, 1403 {want: "4020d41a", setup: func(i *instruction) { 1404 i.asALU(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1405 }}, 1406 {want: "4020d49a", setup: func(i *instruction) { 1407 i.asALU(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1408 }}, 1409 {want: "4024d41a", setup: func(i *instruction) { 1410 i.asALU(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1411 }}, 1412 {want: "4024d49a", setup: func(i *instruction) { 1413 i.asALU(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1414 }}, 1415 {want: "4028d41a", setup: func(i *instruction) { 1416 i.asALU(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1417 }}, 1418 {want: "4028d49a", setup: func(i *instruction) { 1419 i.asALU(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1420 }}, 1421 {want: "400cd49a", setup: func(i *instruction) { 1422 i.asALU(aluOpSDiv, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1423 }}, 1424 {want: "400cd41a", setup: func(i *instruction) { 1425 i.asALU(aluOpSDiv, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1426 }}, 1427 {want: "4008d49a", setup: func(i *instruction) { 1428 i.asALU(aluOpUDiv, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), true) 1429 }}, 1430 {want: "4008d41a", setup: func(i *instruction) { 1431 i.asALU(aluOpUDiv, operandNR(x0VReg), operandNR(x2VReg), operandNR(x20VReg), false) 1432 }}, 1433 {want: "407c0013", setup: func(i *instruction) { 1434 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(0), false) 1435 }}, 1436 {want: "40fc4093", setup: func(i *instruction) { 1437 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(0), true) 1438 }}, 1439 {want: "407c0113", setup: func(i *instruction) { 1440 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), false) 1441 }}, 1442 {want: "407c1f13", setup: func(i *instruction) { 1443 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), false) 1444 }}, 1445 {want: "40fc4193", setup: func(i *instruction) { 1446 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), true) 1447 }}, 1448 {want: "40fc5f93", setup: func(i *instruction) { 1449 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), true) 1450 }}, 1451 {want: "40fc7f93", setup: func(i *instruction) { 1452 i.asALUShift(aluOpAsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(63), true) 1453 }}, 1454 {want: "407c0153", setup: func(i *instruction) { 1455 i.asALUShift(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), false) 1456 }}, 1457 {want: "407c1f53", setup: func(i *instruction) { 1458 i.asALUShift(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), false) 1459 }}, 1460 {want: "40fc41d3", setup: func(i *instruction) { 1461 i.asALUShift(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), true) 1462 }}, 1463 {want: "40fc5fd3", setup: func(i *instruction) { 1464 i.asALUShift(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), true) 1465 }}, 1466 {want: "40fc7fd3", setup: func(i *instruction) { 1467 i.asALUShift(aluOpLsr, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(63), true) 1468 }}, 1469 {want: "407c0053", setup: func(i *instruction) { 1470 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(0), false) 1471 }}, 1472 {want: "40fc40d3", setup: func(i *instruction) { 1473 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(0), true) 1474 }}, 1475 {want: "40781f53", setup: func(i *instruction) { 1476 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), false) 1477 }}, 1478 {want: "40000153", setup: func(i *instruction) { 1479 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), false) 1480 }}, 1481 {want: "40f87fd3", setup: func(i *instruction) { 1482 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(1), true) 1483 }}, 1484 {want: "408061d3", setup: func(i *instruction) { 1485 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(31), true) 1486 }}, 1487 {want: "400041d3", setup: func(i *instruction) { 1488 i.asALUShift(aluOpLsl, operandNR(x0VReg), operandNR(x2VReg), operandShiftImm(63), true) 1489 }}, 1490 {want: "4000c05a", setup: func(i *instruction) { i.asBitRR(bitOpRbit, x0VReg, x2VReg, false) }}, 1491 {want: "4000c0da", setup: func(i *instruction) { i.asBitRR(bitOpRbit, x0VReg, x2VReg, true) }}, 1492 {want: "4010c05a", setup: func(i *instruction) { i.asBitRR(bitOpClz, x0VReg, x2VReg, false) }}, 1493 {want: "4010c0da", setup: func(i *instruction) { i.asBitRR(bitOpClz, x0VReg, x2VReg, true) }}, 1494 {want: "4138302e", setup: func(i *instruction) { 1495 i.asVecLanes(vecOpUaddlv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 1496 }}, 1497 {want: "4138306e", setup: func(i *instruction) { 1498 i.asVecLanes(vecOpUaddlv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 1499 }}, 1500 {want: "4138702e", setup: func(i *instruction) { 1501 i.asVecLanes(vecOpUaddlv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4H) 1502 }}, 1503 {want: "4138706e", setup: func(i *instruction) { 1504 i.asVecLanes(vecOpUaddlv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8H) 1505 }}, 1506 {want: "4138b06e", setup: func(i *instruction) { 1507 i.asVecLanes(vecOpUaddlv, operandNR(v1VReg), operandNR(v2VReg), vecArrangement4S) 1508 }}, 1509 {want: "41c0230e", setup: func(i *instruction) { 1510 i.asVecRRR(vecOpSmull, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1511 }}, 1512 {want: "41c0630e", setup: func(i *instruction) { 1513 i.asVecRRR(vecOpSmull, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 1514 }}, 1515 {want: "41c0a30e", setup: func(i *instruction) { 1516 i.asVecRRR(vecOpSmull, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 1517 }}, 1518 {want: "41c0234e", setup: func(i *instruction) { 1519 i.asVecRRR(vecOpSmull2, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1520 }}, 1521 {want: "41c0634e", setup: func(i *instruction) { 1522 i.asVecRRR(vecOpSmull2, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 1523 }}, 1524 {want: "41c0a34e", setup: func(i *instruction) { 1525 i.asVecRRR(vecOpSmull2, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4S) 1526 }}, 1527 {want: "411c630e", setup: func(i *instruction) { 1528 i.asVecRRR(vecOpBic, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1529 }}, 1530 {want: "411c634e", setup: func(i *instruction) { 1531 i.asVecRRR(vecOpBic, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1532 }}, 1533 {want: "411c632e", setup: func(i *instruction) { 1534 i.asVecRRRRewrite(vecOpBsl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1535 }}, 1536 {want: "411c636e", setup: func(i *instruction) { 1537 i.asVecRRRRewrite(vecOpBsl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1538 }}, 1539 {want: "4158202e", setup: func(i *instruction) { 1540 i.asVecMisc(vecOpNot, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) 1541 }}, 1542 {want: "4158206e", setup: func(i *instruction) { 1543 i.asVecMisc(vecOpNot, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) 1544 }}, 1545 {want: "411c230e", setup: func(i *instruction) { 1546 i.asVecRRR(vecOpAnd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1547 }}, 1548 {want: "411c234e", setup: func(i *instruction) { 1549 i.asVecRRR(vecOpAnd, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1550 }}, 1551 {want: "411ca30e", setup: func(i *instruction) { 1552 i.asVecRRR(vecOpOrr, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1553 }}, 1554 {want: "411ca34e", setup: func(i *instruction) { 1555 i.asVecRRR(vecOpOrr, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1556 }}, 1557 {want: "4144230e", setup: func(i *instruction) { 1558 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1559 }}, 1560 {want: "4144234e", setup: func(i *instruction) { 1561 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1562 }}, 1563 {want: "4144630e", setup: func(i *instruction) { 1564 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 1565 }}, 1566 {want: "4144634e", setup: func(i *instruction) { 1567 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 1568 }}, 1569 {want: "4144a30e", setup: func(i *instruction) { 1570 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 1571 }}, 1572 {want: "4144e34e", setup: func(i *instruction) { 1573 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 1574 }}, 1575 {want: "4144a30e", setup: func(i *instruction) { 1576 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 1577 }}, 1578 {want: "4144232e", setup: func(i *instruction) { 1579 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8B) 1580 }}, 1581 {want: "4144236e", setup: func(i *instruction) { 1582 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement16B) 1583 }}, 1584 {want: "4144632e", setup: func(i *instruction) { 1585 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement4H) 1586 }}, 1587 {want: "4144636e", setup: func(i *instruction) { 1588 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement8H) 1589 }}, 1590 {want: "4144a32e", setup: func(i *instruction) { 1591 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 1592 }}, 1593 {want: "4144e36e", setup: func(i *instruction) { 1594 i.asVecRRR(vecOpUshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2D) 1595 }}, 1596 {want: "4144a30e", setup: func(i *instruction) { 1597 i.asVecRRR(vecOpSshl, operandNR(v1VReg), operandNR(v2VReg), operandNR(v3VReg), vecArrangement2S) 1598 }}, 1599 {want: "4158200e", setup: func(i *instruction) { i.asVecMisc(vecOpCnt, operandNR(v1VReg), operandNR(v2VReg), vecArrangement8B) }}, 1600 {want: "4158204e", setup: func(i *instruction) { i.asVecMisc(vecOpCnt, operandNR(v1VReg), operandNR(v2VReg), vecArrangement16B) }}, 1601 {want: "41c0221e", setup: func(i *instruction) { 1602 i.asFpuRR(fpuUniOpCvt32To64, operandNR(v1VReg), operandNR(v2VReg), true) 1603 }}, 1604 {want: "4140621e", setup: func(i *instruction) { 1605 i.asFpuRR(fpuUniOpCvt64To32, operandNR(v1VReg), operandNR(v2VReg), true) 1606 }}, 1607 {want: "4140211e", setup: func(i *instruction) { 1608 i.asFpuRR(fpuUniOpNeg, operandNR(v1VReg), operandNR(v2VReg), false) 1609 }}, 1610 1611 {want: "41c0211e", setup: func(i *instruction) { 1612 i.asFpuRR(fpuUniOpSqrt, operandNR(v1VReg), operandNR(v2VReg), false) 1613 }}, 1614 {want: "41c0611e", setup: func(i *instruction) { 1615 i.asFpuRR(fpuUniOpSqrt, operandNR(v1VReg), operandNR(v2VReg), true) 1616 }}, 1617 {want: "41c0241e", setup: func(i *instruction) { 1618 i.asFpuRR(fpuUniOpRoundPlus, operandNR(v1VReg), operandNR(v2VReg), false) 1619 }}, 1620 {want: "41c0641e", setup: func(i *instruction) { 1621 i.asFpuRR(fpuUniOpRoundPlus, operandNR(v1VReg), operandNR(v2VReg), true) 1622 }}, 1623 {want: "4140251e", setup: func(i *instruction) { 1624 i.asFpuRR(fpuUniOpRoundMinus, operandNR(v1VReg), operandNR(v2VReg), false) 1625 }}, 1626 {want: "4140651e", setup: func(i *instruction) { 1627 i.asFpuRR(fpuUniOpRoundMinus, operandNR(v1VReg), operandNR(v2VReg), true) 1628 }}, 1629 {want: "41c0251e", setup: func(i *instruction) { 1630 i.asFpuRR(fpuUniOpRoundZero, operandNR(v1VReg), operandNR(v2VReg), false) 1631 }}, 1632 {want: "41c0651e", setup: func(i *instruction) { 1633 i.asFpuRR(fpuUniOpRoundZero, operandNR(v1VReg), operandNR(v2VReg), true) 1634 }}, 1635 {want: "4140241e", setup: func(i *instruction) { 1636 i.asFpuRR(fpuUniOpRoundNearest, operandNR(v1VReg), operandNR(v2VReg), false) 1637 }}, 1638 {want: "4140641e", setup: func(i *instruction) { 1639 i.asFpuRR(fpuUniOpRoundNearest, operandNR(v1VReg), operandNR(v2VReg), true) 1640 }}, 1641 {want: "4140611e", setup: func(i *instruction) { i.asFpuRR(fpuUniOpNeg, operandNR(v1VReg), operandNR(v2VReg), true) }}, 1642 {want: "41c0404d", setup: func(i *instruction) { i.asVecLoad1R(operandNR(v1VReg), operandNR(x2VReg), vecArrangement16B) }}, 1643 {want: "41c4404d", setup: func(i *instruction) { i.asVecLoad1R(operandNR(v1VReg), operandNR(x2VReg), vecArrangement8H) }}, 1644 {want: "41c8404d", setup: func(i *instruction) { i.asVecLoad1R(operandNR(v1VReg), operandNR(x2VReg), vecArrangement4S) }}, 1645 {want: "41cc404d", setup: func(i *instruction) { i.asVecLoad1R(operandNR(v1VReg), operandNR(x2VReg), vecArrangement2D) }}, 1646 {want: "0200e1b8", setup: func(i *instruction) { 1647 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1648 }}, 1649 {want: "0200e178", setup: func(i *instruction) { 1650 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1651 }}, 1652 {want: "0200e138", setup: func(i *instruction) { 1653 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1654 }}, 1655 {want: "0200e1f8", setup: func(i *instruction) { 1656 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1657 }}, 1658 {want: "0200e1b8", setup: func(i *instruction) { 1659 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1660 }}, 1661 {want: "0200e178", setup: func(i *instruction) { 1662 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1663 }}, 1664 {want: "0200e138", setup: func(i *instruction) { 1665 i.asAtomicRmw(atomicRmwOpAdd, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1666 }}, 1667 {want: "0210e1b8", setup: func(i *instruction) { 1668 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1669 }}, 1670 {want: "0210e178", setup: func(i *instruction) { 1671 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1672 }}, 1673 {want: "0210e138", setup: func(i *instruction) { 1674 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1675 }}, 1676 {want: "0210e1f8", setup: func(i *instruction) { 1677 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1678 }}, 1679 {want: "0210e1b8", setup: func(i *instruction) { 1680 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1681 }}, 1682 {want: "0210e178", setup: func(i *instruction) { 1683 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1684 }}, 1685 {want: "0210e138", setup: func(i *instruction) { 1686 i.asAtomicRmw(atomicRmwOpClr, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1687 }}, 1688 {want: "0230e1b8", setup: func(i *instruction) { 1689 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1690 }}, 1691 {want: "0230e178", setup: func(i *instruction) { 1692 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1693 }}, 1694 {want: "0230e138", setup: func(i *instruction) { 1695 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1696 }}, 1697 {want: "0230e1f8", setup: func(i *instruction) { 1698 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1699 }}, 1700 {want: "0230e1b8", setup: func(i *instruction) { 1701 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1702 }}, 1703 {want: "0230e178", setup: func(i *instruction) { 1704 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1705 }}, 1706 {want: "0230e138", setup: func(i *instruction) { 1707 i.asAtomicRmw(atomicRmwOpSet, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1708 }}, 1709 {want: "0220e1b8", setup: func(i *instruction) { 1710 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1711 }}, 1712 {want: "0220e178", setup: func(i *instruction) { 1713 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1714 }}, 1715 {want: "0220e138", setup: func(i *instruction) { 1716 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1717 }}, 1718 {want: "0220e1f8", setup: func(i *instruction) { 1719 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1720 }}, 1721 {want: "0220e1b8", setup: func(i *instruction) { 1722 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1723 }}, 1724 {want: "0220e178", setup: func(i *instruction) { 1725 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1726 }}, 1727 {want: "0220e138", setup: func(i *instruction) { 1728 i.asAtomicRmw(atomicRmwOpEor, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1729 }}, 1730 {want: "0280e1b8", setup: func(i *instruction) { 1731 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1732 }}, 1733 {want: "0280e178", setup: func(i *instruction) { 1734 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1735 }}, 1736 {want: "0280e138", setup: func(i *instruction) { 1737 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1738 }}, 1739 {want: "0280e1f8", setup: func(i *instruction) { 1740 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1741 }}, 1742 {want: "0280e1b8", setup: func(i *instruction) { 1743 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1744 }}, 1745 {want: "0280e178", setup: func(i *instruction) { 1746 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1747 }}, 1748 {want: "0280e138", setup: func(i *instruction) { 1749 i.asAtomicRmw(atomicRmwOpSwp, operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1750 }}, 1751 {want: "02fce188", setup: func(i *instruction) { 1752 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1753 }}, 1754 {want: "02fce148", setup: func(i *instruction) { 1755 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1756 }}, 1757 {want: "02fce108", setup: func(i *instruction) { 1758 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1759 }}, 1760 {want: "02fce1c8", setup: func(i *instruction) { 1761 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 8) 1762 }}, 1763 {want: "02fce188", setup: func(i *instruction) { 1764 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 4) 1765 }}, 1766 {want: "02fce148", setup: func(i *instruction) { 1767 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 2) 1768 }}, 1769 {want: "02fce108", setup: func(i *instruction) { 1770 i.asAtomicCas(operandNR(x0VReg), operandNR(x1VReg), operandNR(x2VReg), 1) 1771 }}, 1772 {want: "01fcdf88", setup: func(i *instruction) { 1773 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 4) 1774 }}, 1775 {want: "01fcdf48", setup: func(i *instruction) { 1776 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 2) 1777 }}, 1778 {want: "01fcdf08", setup: func(i *instruction) { 1779 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 1) 1780 }}, 1781 {want: "01fcdfc8", setup: func(i *instruction) { 1782 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 8) 1783 }}, 1784 {want: "01fcdf88", setup: func(i *instruction) { 1785 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 4) 1786 }}, 1787 {want: "01fcdf48", setup: func(i *instruction) { 1788 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 2) 1789 }}, 1790 {want: "01fcdf08", setup: func(i *instruction) { 1791 i.asAtomicLoad(operandNR(x0VReg), operandNR(x1VReg), 1) 1792 }}, 1793 {want: "01fc9f88", setup: func(i *instruction) { 1794 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 4) 1795 }}, 1796 {want: "01fc9f48", setup: func(i *instruction) { 1797 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 2) 1798 }}, 1799 {want: "01fc9f08", setup: func(i *instruction) { 1800 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 1) 1801 }}, 1802 {want: "01fc9fc8", setup: func(i *instruction) { 1803 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 8) 1804 }}, 1805 {want: "01fc9f88", setup: func(i *instruction) { 1806 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 4) 1807 }}, 1808 {want: "01fc9f48", setup: func(i *instruction) { 1809 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 2) 1810 }}, 1811 {want: "01fc9f08", setup: func(i *instruction) { 1812 i.asAtomicStore(operandNR(x0VReg), operandNR(x1VReg), 1) 1813 }}, 1814 {want: "bf3b03d5", setup: func(i *instruction) { 1815 i.asDMB() 1816 }}, 1817 {want: "4201231e4201631e4201239e4201639e4201221e4201621e4201229e4201629e", setup: func(i *instruction) { 1818 i.asNop0() 1819 cur := i 1820 trueFalse := []bool{false, true} 1821 for _, rnSigned := range trueFalse { 1822 for _, src64bit := range trueFalse { 1823 for _, dst64bit := range trueFalse { 1824 i := &instruction{prev: cur} 1825 cur.next = i 1826 i.asIntToFpu(operandNR(v2VReg), operandNR(x10VReg), rnSigned, src64bit, dst64bit) 1827 cur = i 1828 } 1829 } 1830 } 1831 }}, 1832 {want: "4201391e4201399e4201791e4201799e4201381e4201389e4201781e4201789e", setup: func(i *instruction) { 1833 i.asNop0() 1834 cur := i 1835 trueFalse := []bool{false, true} 1836 for _, rnSigned := range trueFalse { 1837 for _, src64bit := range trueFalse { 1838 for _, dst64bit := range trueFalse { 1839 i := &instruction{prev: cur} 1840 cur.next = i 1841 i.asFpuToInt(operandNR(v2VReg), operandNR(x10VReg), rnSigned, src64bit, dst64bit) 1842 cur = i 1843 } 1844 } 1845 } 1846 }}, 1847 } { 1848 tc := tc 1849 t.Run(tc.want, func(t *testing.T) { 1850 i := &instruction{} 1851 tc.setup(i) 1852 1853 mc := &mockCompiler{} 1854 m := &machine{compiler: mc} 1855 m.encode(i) 1856 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding. 1857 // but wazero doesn't add even a test dependency to it, so commented out. 1858 // inst, err := arm64asm.Decode(m.buf) 1859 // require.NoError(t, err, hex.EncodeToString(m.buf)) 1860 // fmt.Println(inst.String()) 1861 require.Equal(t, tc.want, hex.EncodeToString(mc.buf)) 1862 1863 var actualSize int 1864 for cur := i; cur != nil; cur = cur.next { 1865 actualSize += int(cur.size()) 1866 } 1867 require.Equal(t, len(tc.want)/2, actualSize) 1868 }) 1869 } 1870 } 1871 1872 func TestInstruction_encode_call(t *testing.T) { 1873 _, _, m := newSetupWithMockContext() 1874 mock := m.compiler.(*mockCompiler) 1875 mock.buf = make([]byte, 128) 1876 i := &instruction{} 1877 i.asCall(ssa.FuncRef(555), nil) 1878 i.encode(m) 1879 buf := mock.buf[128:] 1880 require.Equal(t, "00000094", hex.EncodeToString(buf)) 1881 require.Equal(t, 1, len(mock.relocs)) 1882 require.Equal(t, ssa.FuncRef(555), mock.relocs[0].FuncRef) 1883 require.Equal(t, int64(128), mock.relocs[0].Offset) 1884 } 1885 1886 func TestInstruction_encode_br_condflag(t *testing.T) { 1887 for _, tc := range []struct { 1888 c condFlag 1889 want string 1890 }{ 1891 {c: eq, want: "80070054"}, 1892 {c: ne, want: "81070054"}, 1893 {c: hs, want: "82070054"}, 1894 {c: lo, want: "83070054"}, 1895 {c: mi, want: "84070054"}, 1896 {c: pl, want: "85070054"}, 1897 {c: vs, want: "86070054"}, 1898 {c: vc, want: "87070054"}, 1899 {c: hi, want: "88070054"}, 1900 {c: ls, want: "89070054"}, 1901 {c: ge, want: "8a070054"}, 1902 {c: lt, want: "8b070054"}, 1903 {c: gt, want: "8c070054"}, 1904 {c: le, want: "8d070054"}, 1905 {c: al, want: "8e070054"}, 1906 {c: nv, want: "8f070054"}, 1907 } { 1908 i := &instruction{} 1909 i.asCondBr(tc.c.asCond(), label(1), false) 1910 i.condBrOffsetResolve(0xf0) 1911 _, _, m := newSetupWithMockContext() 1912 i.encode(m) 1913 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding. 1914 // but wazero doesn't add even a test dependency to it, so commented out. 1915 // inst, err := arm64asm.Decode(m.buf) 1916 // require.NoError(t, err) 1917 // fmt.Println(inst.String()) 1918 require.Equal(t, tc.want, hex.EncodeToString(m.compiler.Buf())) 1919 } 1920 } 1921 1922 func TestInstruction_encoding_store_encoding(t *testing.T) { 1923 amodeRegScaledExtended1 := addressMode{kind: addressModeKindRegScaledExtended, rn: x30VReg, rm: x1VReg, extOp: extendOpUXTW} 1924 amodeRegScaledExtended2 := addressMode{kind: addressModeKindRegScaledExtended, rn: spVReg, rm: x1VReg, extOp: extendOpSXTW} 1925 amodeRegScaled1 := addressMode{kind: addressModeKindRegScaled, rn: x30VReg, rm: x1VReg} 1926 amodeRegScaled2 := addressMode{kind: addressModeKindRegScaled, rn: spVReg, rm: x1VReg} 1927 amodeRegExtended1 := addressMode{kind: addressModeKindRegExtended, rn: x30VReg, rm: x1VReg, extOp: extendOpUXTW} 1928 amodeRegExtended2 := addressMode{kind: addressModeKindRegExtended, rn: spVReg, rm: x1VReg, extOp: extendOpSXTW} 1929 amodeRegReg1 := addressMode{kind: addressModeKindRegReg, rn: x30VReg, rm: x1VReg} 1930 amodeRegReg2 := addressMode{kind: addressModeKindRegReg, rn: spVReg, rm: x1VReg} 1931 amodeRegSignedImm9_1 := addressMode{kind: addressModeKindRegSignedImm9, rn: x30VReg, imm: 10} 1932 amodeRegSignedImm9_2 := addressMode{kind: addressModeKindRegSignedImm9, rn: spVReg, imm: 0b111111111} 1933 amodePostIndex1 := addressMode{kind: addressModeKindPostIndex, rn: x30VReg, imm: 10} 1934 amodePostIndex2 := addressMode{kind: addressModeKindPostIndex, rn: spVReg, imm: 0b100000000} 1935 amodePreIndex1 := addressMode{kind: addressModeKindPreIndex, rn: x30VReg, imm: 10} 1936 amodePreIndex2 := addressMode{kind: addressModeKindPreIndex, rn: spVReg, imm: 0b100000000} 1937 amodeUnsignedImm12_1 := addressMode{kind: addressModeKindRegUnsignedImm12, rn: x30VReg} 1938 amodeUnsignedImm12_2 := addressMode{kind: addressModeKindRegUnsignedImm12, rn: spVReg} 1939 setImm := func(amode addressMode, imm int64) addressMode { 1940 amode.imm = imm 1941 return amode 1942 } 1943 for _, tc := range []struct { 1944 k instructionKind 1945 amode addressMode 1946 rn regalloc.VReg 1947 want string 1948 }{ 1949 // addressModeKindRegScaledExtended. 1950 {k: store8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b2138"}, 1951 {k: store8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db2138"}, 1952 {k: store16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b2178"}, 1953 {k: store16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db2178"}, 1954 {k: store32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b21b8"}, 1955 {k: store32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db21b8"}, 1956 {k: store64, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b21f8"}, 1957 {k: store64, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db21f8"}, 1958 {k: fpuStore32, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b21bc"}, 1959 {k: fpuStore32, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db21bc"}, 1960 {k: fpuStore64, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b21fc"}, 1961 {k: fpuStore64, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db21fc"}, 1962 {k: fpuStore128, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55ba13c"}, 1963 {k: fpuStore128, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5dba13c"}, 1964 {k: uLoad8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b6138"}, 1965 {k: uLoad8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db6138"}, 1966 {k: uLoad16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b6178"}, 1967 {k: uLoad16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db6178"}, 1968 {k: uLoad32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b61b8"}, 1969 {k: uLoad32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db61b8"}, 1970 {k: uLoad64, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55b61f8"}, 1971 {k: uLoad64, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5db61f8"}, 1972 {k: sLoad8, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba138"}, 1973 {k: sLoad8, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba138"}, 1974 {k: sLoad16, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba178"}, 1975 {k: sLoad16, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba178"}, 1976 {k: sLoad32, amode: amodeRegScaledExtended1, rn: x5VReg, want: "c55ba1b8"}, 1977 {k: sLoad32, amode: amodeRegScaledExtended2, rn: x5VReg, want: "e5dba1b8"}, 1978 {k: fpuLoad32, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b61bc"}, 1979 {k: fpuLoad32, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db61bc"}, 1980 {k: fpuLoad64, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55b61fc"}, 1981 {k: fpuLoad64, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5db61fc"}, 1982 {k: fpuLoad128, amode: amodeRegScaledExtended1, rn: v5VReg, want: "c55be13c"}, 1983 {k: fpuLoad128, amode: amodeRegScaledExtended2, rn: v5VReg, want: "e5dbe13c"}, 1984 // addressModeKindRegScaled. 1985 {k: store8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb2138"}, 1986 {k: store8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb2138"}, 1987 {k: store16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb2178"}, 1988 {k: store16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb2178"}, 1989 {k: store32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb21b8"}, 1990 {k: store32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb21b8"}, 1991 {k: store64, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb21f8"}, 1992 {k: store64, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb21f8"}, 1993 {k: fpuStore32, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb21bc"}, 1994 {k: fpuStore32, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb21bc"}, 1995 {k: fpuStore64, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb21fc"}, 1996 {k: fpuStore64, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb21fc"}, 1997 {k: fpuStore128, amode: amodeRegScaled1, rn: v5VReg, want: "c5fba13c"}, 1998 {k: fpuStore128, amode: amodeRegScaled2, rn: v5VReg, want: "e5fba13c"}, 1999 {k: uLoad8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb6138"}, 2000 {k: uLoad8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb6138"}, 2001 {k: uLoad16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb6178"}, 2002 {k: uLoad16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb6178"}, 2003 {k: uLoad32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb61b8"}, 2004 {k: uLoad32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb61b8"}, 2005 {k: uLoad64, amode: amodeRegScaled1, rn: x5VReg, want: "c5fb61f8"}, 2006 {k: uLoad64, amode: amodeRegScaled2, rn: x5VReg, want: "e5fb61f8"}, 2007 {k: sLoad8, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba138"}, 2008 {k: sLoad8, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba138"}, 2009 {k: sLoad16, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba178"}, 2010 {k: sLoad16, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba178"}, 2011 {k: sLoad32, amode: amodeRegScaled1, rn: x5VReg, want: "c5fba1b8"}, 2012 {k: sLoad32, amode: amodeRegScaled2, rn: x5VReg, want: "e5fba1b8"}, 2013 {k: fpuLoad32, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb61bc"}, 2014 {k: fpuLoad32, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb61bc"}, 2015 {k: fpuLoad64, amode: amodeRegScaled1, rn: v5VReg, want: "c5fb61fc"}, 2016 {k: fpuLoad64, amode: amodeRegScaled2, rn: v5VReg, want: "e5fb61fc"}, 2017 {k: fpuLoad128, amode: amodeRegScaled1, rn: v5VReg, want: "c5fbe13c"}, 2018 {k: fpuLoad128, amode: amodeRegScaled2, rn: v5VReg, want: "e5fbe13c"}, 2019 // addressModeKindRegExtended. 2020 {k: store8, amode: amodeRegExtended1, rn: x5VReg, want: "c54b2138"}, 2021 {k: store8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb2138"}, 2022 {k: store16, amode: amodeRegExtended1, rn: x5VReg, want: "c54b2178"}, 2023 {k: store16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb2178"}, 2024 {k: store32, amode: amodeRegExtended1, rn: x5VReg, want: "c54b21b8"}, 2025 {k: store32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb21b8"}, 2026 {k: store64, amode: amodeRegExtended1, rn: x5VReg, want: "c54b21f8"}, 2027 {k: store64, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb21f8"}, 2028 {k: fpuStore32, amode: amodeRegExtended1, rn: v5VReg, want: "c54b21bc"}, 2029 {k: fpuStore32, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb21bc"}, 2030 {k: fpuStore64, amode: amodeRegExtended1, rn: v5VReg, want: "c54b21fc"}, 2031 {k: fpuStore64, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb21fc"}, 2032 {k: fpuStore128, amode: amodeRegExtended1, rn: v5VReg, want: "c54ba13c"}, 2033 {k: fpuStore128, amode: amodeRegExtended2, rn: v5VReg, want: "e5cba13c"}, 2034 {k: uLoad8, amode: amodeRegExtended1, rn: x5VReg, want: "c54b6138"}, 2035 {k: uLoad8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb6138"}, 2036 {k: uLoad16, amode: amodeRegExtended1, rn: x5VReg, want: "c54b6178"}, 2037 {k: uLoad16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb6178"}, 2038 {k: uLoad32, amode: amodeRegExtended1, rn: x5VReg, want: "c54b61b8"}, 2039 {k: uLoad32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb61b8"}, 2040 {k: uLoad64, amode: amodeRegExtended1, rn: x5VReg, want: "c54b61f8"}, 2041 {k: uLoad64, amode: amodeRegExtended2, rn: x5VReg, want: "e5cb61f8"}, 2042 {k: sLoad8, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba138"}, 2043 {k: sLoad8, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba138"}, 2044 {k: sLoad16, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba178"}, 2045 {k: sLoad16, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba178"}, 2046 {k: sLoad32, amode: amodeRegExtended1, rn: x5VReg, want: "c54ba1b8"}, 2047 {k: sLoad32, amode: amodeRegExtended2, rn: x5VReg, want: "e5cba1b8"}, 2048 {k: fpuLoad32, amode: amodeRegExtended1, rn: v5VReg, want: "c54b61bc"}, 2049 {k: fpuLoad32, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb61bc"}, 2050 {k: fpuLoad64, amode: amodeRegExtended1, rn: v5VReg, want: "c54b61fc"}, 2051 {k: fpuLoad64, amode: amodeRegExtended2, rn: v5VReg, want: "e5cb61fc"}, 2052 {k: fpuLoad128, amode: amodeRegExtended1, rn: v5VReg, want: "c54be13c"}, 2053 {k: fpuLoad128, amode: amodeRegExtended2, rn: v5VReg, want: "e5cbe13c"}, 2054 // addressModeKindRegReg. 2055 {k: store8, amode: amodeRegReg1, rn: x5VReg, want: "c5eb2138"}, 2056 {k: store8, amode: amodeRegReg2, rn: x5VReg, want: "e5eb2138"}, 2057 {k: store16, amode: amodeRegReg1, rn: x5VReg, want: "c5eb2178"}, 2058 {k: store16, amode: amodeRegReg2, rn: x5VReg, want: "e5eb2178"}, 2059 {k: store32, amode: amodeRegReg1, rn: x5VReg, want: "c5eb21b8"}, 2060 {k: store32, amode: amodeRegReg2, rn: x5VReg, want: "e5eb21b8"}, 2061 {k: store64, amode: amodeRegReg1, rn: x5VReg, want: "c5eb21f8"}, 2062 {k: store64, amode: amodeRegReg2, rn: x5VReg, want: "e5eb21f8"}, 2063 {k: fpuStore32, amode: amodeRegReg1, rn: v5VReg, want: "c5eb21bc"}, 2064 {k: fpuStore32, amode: amodeRegReg2, rn: v5VReg, want: "e5eb21bc"}, 2065 {k: fpuStore64, amode: amodeRegReg1, rn: v5VReg, want: "c5eb21fc"}, 2066 {k: fpuStore64, amode: amodeRegReg2, rn: v5VReg, want: "e5eb21fc"}, 2067 {k: fpuStore128, amode: amodeRegReg1, rn: v5VReg, want: "c5eba13c"}, 2068 {k: fpuStore128, amode: amodeRegReg2, rn: v5VReg, want: "e5eba13c"}, 2069 {k: uLoad8, amode: amodeRegReg1, rn: x5VReg, want: "c5eb6138"}, 2070 {k: uLoad8, amode: amodeRegReg2, rn: x5VReg, want: "e5eb6138"}, 2071 {k: uLoad16, amode: amodeRegReg1, rn: x5VReg, want: "c5eb6178"}, 2072 {k: uLoad16, amode: amodeRegReg2, rn: x5VReg, want: "e5eb6178"}, 2073 {k: uLoad32, amode: amodeRegReg1, rn: x5VReg, want: "c5eb61b8"}, 2074 {k: uLoad32, amode: amodeRegReg2, rn: x5VReg, want: "e5eb61b8"}, 2075 {k: uLoad64, amode: amodeRegReg1, rn: x5VReg, want: "c5eb61f8"}, 2076 {k: uLoad64, amode: amodeRegReg2, rn: x5VReg, want: "e5eb61f8"}, 2077 {k: sLoad8, amode: amodeRegReg1, rn: x5VReg, want: "c5eba138"}, 2078 {k: sLoad8, amode: amodeRegReg2, rn: x5VReg, want: "e5eba138"}, 2079 {k: sLoad16, amode: amodeRegReg1, rn: x5VReg, want: "c5eba178"}, 2080 {k: sLoad16, amode: amodeRegReg2, rn: x5VReg, want: "e5eba178"}, 2081 {k: sLoad32, amode: amodeRegReg1, rn: x5VReg, want: "c5eba1b8"}, 2082 {k: sLoad32, amode: amodeRegReg2, rn: x5VReg, want: "e5eba1b8"}, 2083 {k: fpuLoad32, amode: amodeRegReg1, rn: v5VReg, want: "c5eb61bc"}, 2084 {k: fpuLoad32, amode: amodeRegReg2, rn: v5VReg, want: "e5eb61bc"}, 2085 {k: fpuLoad64, amode: amodeRegReg1, rn: v5VReg, want: "c5eb61fc"}, 2086 {k: fpuLoad64, amode: amodeRegReg2, rn: v5VReg, want: "e5eb61fc"}, 2087 {k: fpuLoad128, amode: amodeRegReg1, rn: v5VReg, want: "c5ebe13c"}, 2088 {k: fpuLoad128, amode: amodeRegReg2, rn: v5VReg, want: "e5ebe13c"}, 2089 // addressModeKindRegSignedImm9. 2090 {k: store8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a30038"}, 2091 {k: store8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31f38"}, 2092 {k: store16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a30078"}, 2093 {k: store16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31f78"}, 2094 {k: store32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a300b8"}, 2095 {k: store32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31fb8"}, 2096 {k: store64, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a300f8"}, 2097 {k: store64, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f31ff8"}, 2098 {k: fpuStore32, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a300bc"}, 2099 {k: fpuStore32, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f31fbc"}, 2100 {k: fpuStore64, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a300fc"}, 2101 {k: fpuStore64, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f31ffc"}, 2102 {k: fpuStore128, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a3803c"}, 2103 {k: fpuStore128, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f39f3c"}, 2104 {k: uLoad8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a34038"}, 2105 {k: uLoad8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35f38"}, 2106 {k: uLoad16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a34078"}, 2107 {k: uLoad16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35f78"}, 2108 {k: uLoad32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a340b8"}, 2109 {k: uLoad32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35fb8"}, 2110 {k: uLoad64, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a340f8"}, 2111 {k: uLoad64, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f35ff8"}, 2112 {k: sLoad8, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a38038"}, 2113 {k: sLoad8, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39f38"}, 2114 {k: sLoad16, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a38078"}, 2115 {k: sLoad16, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39f78"}, 2116 {k: sLoad32, amode: amodeRegSignedImm9_1, rn: x5VReg, want: "c5a380b8"}, 2117 {k: sLoad32, amode: amodeRegSignedImm9_2, rn: x5VReg, want: "e5f39fb8"}, 2118 {k: fpuLoad32, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a340bc"}, 2119 {k: fpuLoad32, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f35fbc"}, 2120 {k: fpuLoad64, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a340fc"}, 2121 {k: fpuLoad64, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f35ffc"}, 2122 {k: fpuLoad128, amode: amodeRegSignedImm9_1, rn: v5VReg, want: "c5a3c03c"}, 2123 {k: fpuLoad128, amode: amodeRegSignedImm9_2, rn: v5VReg, want: "e5f3df3c"}, 2124 // addressModeKindPostIndex. 2125 {k: store8, amode: amodePostIndex1, rn: x5VReg, want: "c5a70038"}, 2126 {k: store8, amode: amodePostIndex2, rn: x5VReg, want: "e5071038"}, 2127 {k: store16, amode: amodePostIndex1, rn: x5VReg, want: "c5a70078"}, 2128 {k: store16, amode: amodePostIndex2, rn: x5VReg, want: "e5071078"}, 2129 {k: store32, amode: amodePostIndex1, rn: x5VReg, want: "c5a700b8"}, 2130 {k: store32, amode: amodePostIndex2, rn: x5VReg, want: "e50710b8"}, 2131 {k: store64, amode: amodePostIndex1, rn: x5VReg, want: "c5a700f8"}, 2132 {k: store64, amode: amodePostIndex2, rn: x5VReg, want: "e50710f8"}, 2133 {k: fpuStore32, amode: amodePostIndex1, rn: v5VReg, want: "c5a700bc"}, 2134 {k: fpuStore32, amode: amodePostIndex2, rn: v5VReg, want: "e50710bc"}, 2135 {k: fpuStore64, amode: amodePostIndex1, rn: v5VReg, want: "c5a700fc"}, 2136 {k: fpuStore64, amode: amodePostIndex2, rn: v5VReg, want: "e50710fc"}, 2137 {k: fpuStore128, amode: amodePostIndex1, rn: v5VReg, want: "c5a7803c"}, 2138 {k: fpuStore128, amode: amodePostIndex2, rn: v5VReg, want: "e507903c"}, 2139 {k: uLoad8, amode: amodePostIndex1, rn: x5VReg, want: "c5a74038"}, 2140 {k: uLoad8, amode: amodePostIndex2, rn: x5VReg, want: "e5075038"}, 2141 {k: uLoad16, amode: amodePostIndex1, rn: x5VReg, want: "c5a74078"}, 2142 {k: uLoad16, amode: amodePostIndex2, rn: x5VReg, want: "e5075078"}, 2143 {k: uLoad32, amode: amodePostIndex1, rn: x5VReg, want: "c5a740b8"}, 2144 {k: uLoad32, amode: amodePostIndex2, rn: x5VReg, want: "e50750b8"}, 2145 {k: uLoad64, amode: amodePostIndex1, rn: x5VReg, want: "c5a740f8"}, 2146 {k: uLoad64, amode: amodePostIndex2, rn: x5VReg, want: "e50750f8"}, 2147 {k: sLoad8, amode: amodePostIndex1, rn: x5VReg, want: "c5a78038"}, 2148 {k: sLoad8, amode: amodePostIndex2, rn: x5VReg, want: "e5079038"}, 2149 {k: sLoad16, amode: amodePostIndex1, rn: x5VReg, want: "c5a78078"}, 2150 {k: sLoad16, amode: amodePostIndex2, rn: x5VReg, want: "e5079078"}, 2151 {k: sLoad32, amode: amodePostIndex1, rn: x5VReg, want: "c5a780b8"}, 2152 {k: sLoad32, amode: amodePostIndex2, rn: x5VReg, want: "e50790b8"}, 2153 {k: fpuLoad32, amode: amodePostIndex1, rn: v5VReg, want: "c5a740bc"}, 2154 {k: fpuLoad32, amode: amodePostIndex2, rn: v5VReg, want: "e50750bc"}, 2155 {k: fpuLoad64, amode: amodePostIndex1, rn: v5VReg, want: "c5a740fc"}, 2156 {k: fpuLoad64, amode: amodePostIndex2, rn: v5VReg, want: "e50750fc"}, 2157 {k: fpuLoad128, amode: amodePostIndex1, rn: v5VReg, want: "c5a7c03c"}, 2158 {k: fpuLoad128, amode: amodePostIndex2, rn: v5VReg, want: "e507d03c"}, 2159 // addressModeKindPreIndex. 2160 {k: store8, amode: amodePreIndex1, rn: x5VReg, want: "c5af0038"}, 2161 {k: store8, amode: amodePreIndex2, rn: x5VReg, want: "e50f1038"}, 2162 {k: store16, amode: amodePreIndex1, rn: x5VReg, want: "c5af0078"}, 2163 {k: store16, amode: amodePreIndex2, rn: x5VReg, want: "e50f1078"}, 2164 {k: store32, amode: amodePreIndex1, rn: x5VReg, want: "c5af00b8"}, 2165 {k: store32, amode: amodePreIndex2, rn: x5VReg, want: "e50f10b8"}, 2166 {k: store64, amode: amodePreIndex1, rn: x5VReg, want: "c5af00f8"}, 2167 {k: store64, amode: amodePreIndex2, rn: x5VReg, want: "e50f10f8"}, 2168 {k: store64, amode: amodePreIndex2, rn: xzrVReg, want: "ff0f10f8"}, 2169 {k: fpuStore32, amode: amodePreIndex1, rn: v5VReg, want: "c5af00bc"}, 2170 {k: fpuStore32, amode: amodePreIndex2, rn: v5VReg, want: "e50f10bc"}, 2171 {k: fpuStore64, amode: amodePreIndex1, rn: v5VReg, want: "c5af00fc"}, 2172 {k: fpuStore64, amode: amodePreIndex2, rn: v5VReg, want: "e50f10fc"}, 2173 {k: fpuStore128, amode: amodePreIndex1, rn: v5VReg, want: "c5af803c"}, 2174 {k: fpuStore128, amode: amodePreIndex2, rn: v5VReg, want: "e50f903c"}, 2175 {k: uLoad8, amode: amodePreIndex1, rn: x5VReg, want: "c5af4038"}, 2176 {k: uLoad8, amode: amodePreIndex2, rn: x5VReg, want: "e50f5038"}, 2177 {k: uLoad16, amode: amodePreIndex1, rn: x5VReg, want: "c5af4078"}, 2178 {k: uLoad16, amode: amodePreIndex2, rn: x5VReg, want: "e50f5078"}, 2179 {k: uLoad32, amode: amodePreIndex1, rn: x5VReg, want: "c5af40b8"}, 2180 {k: uLoad32, amode: amodePreIndex2, rn: x5VReg, want: "e50f50b8"}, 2181 {k: uLoad64, amode: amodePreIndex1, rn: x5VReg, want: "c5af40f8"}, 2182 {k: uLoad64, amode: amodePreIndex2, rn: x5VReg, want: "e50f50f8"}, 2183 {k: sLoad8, amode: amodePreIndex1, rn: x5VReg, want: "c5af8038"}, 2184 {k: sLoad8, amode: amodePreIndex2, rn: x5VReg, want: "e50f9038"}, 2185 {k: sLoad16, amode: amodePreIndex1, rn: x5VReg, want: "c5af8078"}, 2186 {k: sLoad16, amode: amodePreIndex2, rn: x5VReg, want: "e50f9078"}, 2187 {k: sLoad32, amode: amodePreIndex1, rn: x5VReg, want: "c5af80b8"}, 2188 {k: sLoad32, amode: amodePreIndex2, rn: x5VReg, want: "e50f90b8"}, 2189 {k: fpuLoad32, amode: amodePreIndex1, rn: v5VReg, want: "c5af40bc"}, 2190 {k: fpuLoad32, amode: amodePreIndex2, rn: v5VReg, want: "e50f50bc"}, 2191 {k: fpuLoad64, amode: amodePreIndex1, rn: v5VReg, want: "c5af40fc"}, 2192 {k: fpuLoad64, amode: amodePreIndex2, rn: v5VReg, want: "e50f50fc"}, 2193 {k: fpuLoad128, amode: amodePreIndex1, rn: v5VReg, want: "c5afc03c"}, 2194 {k: fpuLoad128, amode: amodePreIndex2, rn: v5VReg, want: "e50fd03c"}, 2195 // addressModeKindRegUnsignedImm12. 2196 {k: store8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b0039"}, 2197 {k: store8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ff3f39"}, 2198 {k: store16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5170079"}, 2199 {k: store16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ff3f79"}, 2200 {k: store32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51300b9"}, 2201 {k: store32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ff3fb9"}, 2202 {k: store64, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c50b00f9"}, 2203 {k: store64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: x5VReg, want: "e5ff3ff9"}, 2204 {k: fpuStore32, amode: setImm(amodeUnsignedImm12_1, 256), rn: v5VReg, want: "c50301bd"}, 2205 {k: fpuStore32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: v5VReg, want: "e5ff3fbd"}, 2206 {k: fpuStore64, amode: setImm(amodeUnsignedImm12_1, 512), rn: v5VReg, want: "c50301fd"}, 2207 {k: fpuStore64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: v5VReg, want: "e5ff3ffd"}, 2208 {k: fpuStore128, amode: setImm(amodeUnsignedImm12_1, 16), rn: v5VReg, want: "c507803d"}, 2209 {k: fpuStore128, amode: setImm(amodeUnsignedImm12_2, 4095*16), rn: v5VReg, want: "e5ffbf3d"}, 2210 {k: uLoad8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b4039"}, 2211 {k: uLoad8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ff7f39"}, 2212 {k: uLoad16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5174079"}, 2213 {k: uLoad16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ff7f79"}, 2214 {k: uLoad32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51340b9"}, 2215 {k: uLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ff7fb9"}, 2216 {k: uLoad64, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c50b40f9"}, 2217 {k: uLoad64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: x5VReg, want: "e5ff7ff9"}, 2218 {k: sLoad8, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c52b8039"}, 2219 {k: sLoad8, amode: setImm(amodeUnsignedImm12_2, 4095), rn: x5VReg, want: "e5ffbf39"}, 2220 {k: sLoad16, amode: setImm(amodeUnsignedImm12_1, 10), rn: x5VReg, want: "c5178079"}, 2221 {k: sLoad16, amode: setImm(amodeUnsignedImm12_2, 4095*2), rn: x5VReg, want: "e5ffbf79"}, 2222 {k: sLoad32, amode: setImm(amodeUnsignedImm12_1, 16), rn: x5VReg, want: "c51380b9"}, 2223 {k: sLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: x5VReg, want: "e5ffbfb9"}, 2224 {k: fpuLoad32, amode: setImm(amodeUnsignedImm12_1, 256), rn: v5VReg, want: "c50341bd"}, 2225 {k: fpuLoad32, amode: setImm(amodeUnsignedImm12_2, 4095*4), rn: v5VReg, want: "e5ff7fbd"}, 2226 {k: fpuLoad64, amode: setImm(amodeUnsignedImm12_1, 512), rn: v5VReg, want: "c50341fd"}, 2227 {k: fpuLoad64, amode: setImm(amodeUnsignedImm12_2, 4095*8), rn: v5VReg, want: "e5ff7ffd"}, 2228 {k: fpuLoad128, amode: setImm(amodeUnsignedImm12_1, 16), rn: v5VReg, want: "c507c03d"}, 2229 {k: fpuLoad128, amode: setImm(amodeUnsignedImm12_2, 4095*16), rn: v5VReg, want: "e5ffff3d"}, 2230 } { 2231 t.Run(tc.want, func(t *testing.T) { 2232 var i *instruction 2233 switch tc.k { 2234 case store8, store16, store32, store64, fpuStore32, fpuStore64, fpuStore128: 2235 i = &instruction{kind: tc.k, amode: tc.amode, rn: operandNR(tc.rn)} 2236 case uLoad8, uLoad16, uLoad32, uLoad64, sLoad8, sLoad16, sLoad32, fpuLoad32, fpuLoad64, fpuLoad128: 2237 i = &instruction{kind: tc.k, amode: tc.amode, rd: operandNR(tc.rn)} 2238 default: 2239 t.Fatalf("unknown kind: %v", tc.k) 2240 } 2241 _, _, m := newSetupWithMockContext() 2242 i.encode(m) 2243 // Note: for quick iteration we can use golang.org/x/arch package to verify the encoding. 2244 // but wazero doesn't add even a test dependency to it, so commented out. 2245 // inst, err := arm64asm.Decode(m.buf) 2246 // require.NoError(t, err) 2247 // fmt.Println(inst.String()) 2248 require.Equal(t, tc.want, hex.EncodeToString(m.compiler.Buf())) 2249 }) 2250 } 2251 } 2252 2253 func Test_encodeExitSequence(t *testing.T) { 2254 t.Run("no overlap", func(t *testing.T) { 2255 m := &mockCompiler{} 2256 encodeExitSequence(m, x22VReg) 2257 // ldr x29, [x22, #0x10] 2258 // ldr x30, [x22, #0x20] 2259 // ldr x27, [x22, #0x18] 2260 // mov sp, x27 2261 // ret 2262 // b #0x14 ;; dummy 2263 require.Equal(t, "dd0a40f9de1240f9db0e40f97f030091c0035fd600000014", hex.EncodeToString(m.buf)) 2264 require.Equal(t, len(m.buf), exitSequenceSize) 2265 }) 2266 t.Run("fp", func(t *testing.T) { 2267 m := &mockCompiler{} 2268 encodeExitSequence(m, fpVReg) 2269 // mov x27, x29 2270 // ldr x29, [x27, #0x10] 2271 // ldr x30, [x27, #0x20] 2272 // ldr x27, [x27, #0x18] 2273 // mov sp, x27 2274 // ret 2275 require.Equal(t, "fb031daa7d0b40f97e1340f97b0f40f97f030091c0035fd6", hex.EncodeToString(m.buf)) 2276 require.Equal(t, len(m.buf), exitSequenceSize) 2277 }) 2278 t.Run("lr", func(t *testing.T) { 2279 m := &mockCompiler{} 2280 encodeExitSequence(m, lrVReg) 2281 // mov x27, x30 2282 // ldr x29, [x27, #0x10] 2283 // ldr x30, [x27, #0x20] 2284 // ldr x27, [x27, #0x18] 2285 // mov sp, x27 2286 // ret 2287 require.Equal(t, "fb031eaa7d0b40f97e1340f97b0f40f97f030091c0035fd6", hex.EncodeToString(m.buf)) 2288 require.Equal(t, len(m.buf), exitSequenceSize) 2289 }) 2290 } 2291 2292 func Test_encodeBrTableSequence(t *testing.T) { 2293 _, _, m := newSetupWithMockContext() 2294 i := &instruction{} 2295 const tableIndex, tableSize = 5, 10 2296 i.asBrTableSequence(x22VReg, tableIndex, tableSize) 2297 m.jmpTableTargets = [][]uint32{{}, {}, {}, {}, {}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}} 2298 i.encode(m) 2299 encoded := m.compiler.Buf() 2300 require.Equal(t, i.size(), int64(len(encoded))) 2301 require.Equal(t, "9b000010765bb6b87b03168b60031fd6", hex.EncodeToString(encoded[:brTableSequenceOffsetTableBegin])) 2302 require.Equal(t, "0100000002000000030000000400000005000000060000000700000008000000090000000a000000", hex.EncodeToString(encoded[brTableSequenceOffsetTableBegin:])) 2303 } 2304 2305 func Test_encodeUnconditionalBranch(t *testing.T) { 2306 buf := make([]byte, 4) 2307 2308 actual := encodeUnconditionalBranch(true, 4) 2309 binary.LittleEndian.PutUint32(buf, actual) 2310 require.Equal(t, "0x01000094", fmt.Sprintf("%#x", buf)) 2311 2312 actual = encodeUnconditionalBranch(false, 4*1024) 2313 binary.LittleEndian.PutUint32(buf, actual) 2314 require.Equal(t, "0x00040014", fmt.Sprintf("%#x", buf)) 2315 }