| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "src/arm64/disasm-arm64.h" | 41 #include "src/arm64/disasm-arm64.h" |
| 42 #include "src/arm64/macro-assembler-arm64.h" | 42 #include "src/arm64/macro-assembler-arm64.h" |
| 43 #include "src/arm64/utils-arm64.h" | 43 #include "src/arm64/utils-arm64.h" |
| 44 | 44 |
| 45 using namespace v8::internal; | 45 using namespace v8::internal; |
| 46 | 46 |
| 47 #define TEST_(name) TEST(DISASM_##name) | 47 #define TEST_(name) TEST(DISASM_##name) |
| 48 | 48 |
| 49 #define EXP_SIZE (256) | 49 #define EXP_SIZE (256) |
| 50 #define INSTR_SIZE (1024) | 50 #define INSTR_SIZE (1024) |
| 51 #define SET_UP_CLASS(ASMCLASS) \ | 51 #define SET_UP_MASM() \ |
| 52 InitializeVM(); \ |
| 53 Isolate* isolate = CcTest::i_isolate(); \ |
| 54 HandleScope scope(isolate); \ |
| 55 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ |
| 56 uint32_t encoding = 0; \ |
| 57 MacroAssembler* assm = new MacroAssembler(isolate, buf, INSTR_SIZE, true); \ |
| 58 Decoder<DispatchingDecoderVisitor>* decoder = \ |
| 59 new Decoder<DispatchingDecoderVisitor>(); \ |
| 60 DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ |
| 61 decoder->AppendVisitor(disasm) |
| 62 |
| 63 #define SET_UP_ASM() \ |
| 52 InitializeVM(); \ | 64 InitializeVM(); \ |
| 53 Isolate* isolate = CcTest::i_isolate(); \ | 65 Isolate* isolate = CcTest::i_isolate(); \ |
| 54 HandleScope scope(isolate); \ | 66 HandleScope scope(isolate); \ |
| 55 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ | 67 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ |
| 56 uint32_t encoding = 0; \ | 68 uint32_t encoding = 0; \ |
| 57 ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \ | 69 Assembler* assm = new Assembler(isolate, buf, INSTR_SIZE); \ |
| 58 Decoder<DispatchingDecoderVisitor>* decoder = \ | 70 Decoder<DispatchingDecoderVisitor>* decoder = \ |
| 59 new Decoder<DispatchingDecoderVisitor>(); \ | 71 new Decoder<DispatchingDecoderVisitor>(); \ |
| 60 DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ | 72 DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ |
| 61 decoder->AppendVisitor(disasm) | 73 decoder->AppendVisitor(disasm) |
| 62 | 74 |
| 63 #define SET_UP() SET_UP_CLASS(Assembler) | |
| 64 | |
| 65 #define COMPARE(ASM, EXP) \ | 75 #define COMPARE(ASM, EXP) \ |
| 66 assm->Reset(); \ | 76 assm->Reset(); \ |
| 67 assm->ASM; \ | 77 assm->ASM; \ |
| 68 assm->GetCode(NULL); \ | 78 assm->GetCode(NULL); \ |
| 69 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \ | 79 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \ |
| 70 encoding = *reinterpret_cast<uint32_t*>(buf); \ | 80 encoding = *reinterpret_cast<uint32_t*>(buf); \ |
| 71 if (strcmp(disasm->GetOutput(), EXP) != 0) { \ | 81 if (strcmp(disasm->GetOutput(), EXP) != 0) { \ |
| 72 printf("%u : Encoding: %08" PRIx32 "\nExpected: %s\nFound: %s\n", \ | 82 printf("%u : Encoding: %08" PRIx32 "\nExpected: %s\nFound: %s\n", \ |
| 73 __LINE__, encoding, EXP, disasm->GetOutput()); \ | 83 __LINE__, encoding, EXP, disasm->GetOutput()); \ |
| 74 abort(); \ | 84 abort(); \ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 98 | 108 |
| 99 static void InitializeVM() { | 109 static void InitializeVM() { |
| 100 if (!vm_initialized) { | 110 if (!vm_initialized) { |
| 101 CcTest::InitializeVM(); | 111 CcTest::InitializeVM(); |
| 102 vm_initialized = true; | 112 vm_initialized = true; |
| 103 } | 113 } |
| 104 } | 114 } |
| 105 | 115 |
| 106 | 116 |
| 107 TEST_(bootstrap) { | 117 TEST_(bootstrap) { |
| 108 SET_UP(); | 118 SET_UP_ASM(); |
| 109 | 119 |
| 110 // Instructions generated by C compiler, disassembled by objdump, and | 120 // Instructions generated by C compiler, disassembled by objdump, and |
| 111 // reformatted to suit our disassembly style. | 121 // reformatted to suit our disassembly style. |
| 112 COMPARE(dci(0xa9ba7bfd), "stp fp, lr, [csp, #-96]!"); | 122 COMPARE(dci(0xa9ba7bfd), "stp fp, lr, [csp, #-96]!"); |
| 113 COMPARE(dci(0x910003fd), "mov fp, csp"); | 123 COMPARE(dci(0x910003fd), "mov fp, csp"); |
| 114 COMPARE(dci(0x9100e3a0), "add x0, fp, #0x38 (56)"); | 124 COMPARE(dci(0x9100e3a0), "add x0, fp, #0x38 (56)"); |
| 115 COMPARE(dci(0xb900001f), "str wzr, [x0]"); | 125 COMPARE(dci(0xb900001f), "str wzr, [x0]"); |
| 116 COMPARE(dci(0x528000e1), "movz w1, #0x7"); | 126 COMPARE(dci(0x528000e1), "movz w1, #0x7"); |
| 117 COMPARE(dci(0xb9001c01), "str w1, [x0, #28]"); | 127 COMPARE(dci(0xb9001c01), "str w1, [x0, #28]"); |
| 118 COMPARE(dci(0x390043a0), "strb w0, [fp, #16]"); | 128 COMPARE(dci(0x390043a0), "strb w0, [fp, #16]"); |
| 119 COMPARE(dci(0x790027a0), "strh w0, [fp, #18]"); | 129 COMPARE(dci(0x790027a0), "strh w0, [fp, #18]"); |
| 120 COMPARE(dci(0xb9400400), "ldr w0, [x0, #4]"); | 130 COMPARE(dci(0xb9400400), "ldr w0, [x0, #4]"); |
| 121 COMPARE(dci(0x0b000021), "add w1, w1, w0"); | 131 COMPARE(dci(0x0b000021), "add w1, w1, w0"); |
| 122 COMPARE(dci(0x531b6800), "lsl w0, w0, #5"); | 132 COMPARE(dci(0x531b6800), "lsl w0, w0, #5"); |
| 123 COMPARE(dci(0x521e0400), "eor w0, w0, #0xc"); | 133 COMPARE(dci(0x521e0400), "eor w0, w0, #0xc"); |
| 124 COMPARE(dci(0x72af0f00), "movk w0, #0x7878, lsl #16"); | 134 COMPARE(dci(0x72af0f00), "movk w0, #0x7878, lsl #16"); |
| 125 COMPARE(dci(0xd360fc00), "lsr x0, x0, #32"); | 135 COMPARE(dci(0xd360fc00), "lsr x0, x0, #32"); |
| 126 COMPARE(dci(0x13037c01), "asr w1, w0, #3"); | 136 COMPARE(dci(0x13037c01), "asr w1, w0, #3"); |
| 127 COMPARE(dci(0x4b000021), "sub w1, w1, w0"); | 137 COMPARE(dci(0x4b000021), "sub w1, w1, w0"); |
| 128 COMPARE(dci(0x2a0103e0), "mov w0, w1"); | 138 COMPARE(dci(0x2a0103e0), "mov w0, w1"); |
| 129 COMPARE(dci(0x93407c00), "sxtw x0, w0"); | 139 COMPARE(dci(0x93407c00), "sxtw x0, w0"); |
| 130 COMPARE(dci(0x2a000020), "orr w0, w1, w0"); | 140 COMPARE(dci(0x2a000020), "orr w0, w1, w0"); |
| 131 COMPARE(dci(0xa8c67bfd), "ldp fp, lr, [csp], #96"); | 141 COMPARE(dci(0xa8c67bfd), "ldp fp, lr, [csp], #96"); |
| 132 | 142 |
| 133 CLEANUP(); | 143 CLEANUP(); |
| 134 } | 144 } |
| 135 | 145 |
| 136 | 146 |
| 137 TEST_(mov_mvn) { | 147 TEST_(mov_mvn) { |
| 138 SET_UP_CLASS(MacroAssembler); | 148 SET_UP_MASM(); |
| 139 | 149 |
| 140 COMPARE(Mov(w0, Operand(0x1234)), "movz w0, #0x1234"); | 150 COMPARE(Mov(w0, Operand(0x1234)), "movz w0, #0x1234"); |
| 141 COMPARE(Mov(x1, Operand(0x1234)), "movz x1, #0x1234"); | 151 COMPARE(Mov(x1, Operand(0x1234)), "movz x1, #0x1234"); |
| 142 COMPARE(Mov(w2, Operand(w3)), "mov w2, w3"); | 152 COMPARE(Mov(w2, Operand(w3)), "mov w2, w3"); |
| 143 COMPARE(Mov(x4, Operand(x5)), "mov x4, x5"); | 153 COMPARE(Mov(x4, Operand(x5)), "mov x4, x5"); |
| 144 COMPARE(Mov(w6, Operand(w7, LSL, 5)), "lsl w6, w7, #5"); | 154 COMPARE(Mov(w6, Operand(w7, LSL, 5)), "lsl w6, w7, #5"); |
| 145 COMPARE(Mov(x8, Operand(x9, ASR, 42)), "asr x8, x9, #42"); | 155 COMPARE(Mov(x8, Operand(x9, ASR, 42)), "asr x8, x9, #42"); |
| 146 COMPARE(Mov(w10, Operand(w11, UXTB)), "uxtb w10, w11"); | 156 COMPARE(Mov(w10, Operand(w11, UXTB)), "uxtb w10, w11"); |
| 147 COMPARE(Mov(x12, Operand(x13, UXTB, 1)), "ubfiz x12, x13, #1, #8"); | 157 COMPARE(Mov(x12, Operand(x13, UXTB, 1)), "ubfiz x12, x13, #1, #8"); |
| 148 COMPARE(Mov(w14, Operand(w15, SXTH, 2)), "sbfiz w14, w15, #2, #16"); | 158 COMPARE(Mov(w14, Operand(w15, SXTH, 2)), "sbfiz w14, w15, #2, #16"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 162 COMPARE(Mvn(w2, Operand(w3)), "mvn w2, w3"); | 172 COMPARE(Mvn(w2, Operand(w3)), "mvn w2, w3"); |
| 163 COMPARE(Mvn(x4, Operand(x5)), "mvn x4, x5"); | 173 COMPARE(Mvn(x4, Operand(x5)), "mvn x4, x5"); |
| 164 COMPARE(Mvn(w6, Operand(w7, LSL, 12)), "mvn w6, w7, lsl #12"); | 174 COMPARE(Mvn(w6, Operand(w7, LSL, 12)), "mvn w6, w7, lsl #12"); |
| 165 COMPARE(Mvn(x8, Operand(x9, ASR, 63)), "mvn x8, x9, asr #63"); | 175 COMPARE(Mvn(x8, Operand(x9, ASR, 63)), "mvn x8, x9, asr #63"); |
| 166 | 176 |
| 167 CLEANUP(); | 177 CLEANUP(); |
| 168 } | 178 } |
| 169 | 179 |
| 170 | 180 |
| 171 TEST_(move_immediate) { | 181 TEST_(move_immediate) { |
| 172 SET_UP(); | 182 SET_UP_ASM(); |
| 173 | 183 |
| 174 COMPARE(movz(w0, 0x1234), "movz w0, #0x1234"); | 184 COMPARE(movz(w0, 0x1234), "movz w0, #0x1234"); |
| 175 COMPARE(movz(x1, 0xabcd0000), "movz x1, #0xabcd0000"); | 185 COMPARE(movz(x1, 0xabcd0000), "movz x1, #0xabcd0000"); |
| 176 COMPARE(movz(x2, 0x555500000000), "movz x2, #0x555500000000"); | 186 COMPARE(movz(x2, 0x555500000000), "movz x2, #0x555500000000"); |
| 177 COMPARE(movz(x3, 0xaaaa000000000000), "movz x3, #0xaaaa000000000000"); | 187 COMPARE(movz(x3, 0xaaaa000000000000), "movz x3, #0xaaaa000000000000"); |
| 178 COMPARE(movz(x4, 0xabcd, 16), "movz x4, #0xabcd0000"); | 188 COMPARE(movz(x4, 0xabcd, 16), "movz x4, #0xabcd0000"); |
| 179 COMPARE(movz(x5, 0x5555, 32), "movz x5, #0x555500000000"); | 189 COMPARE(movz(x5, 0x5555, 32), "movz x5, #0x555500000000"); |
| 180 COMPARE(movz(x6, 0xaaaa, 48), "movz x6, #0xaaaa000000000000"); | 190 COMPARE(movz(x6, 0xaaaa, 48), "movz x6, #0xaaaa000000000000"); |
| 181 | 191 |
| 182 COMPARE(movk(w7, 0x1234), "movk w7, #0x1234"); | 192 COMPARE(movk(w7, 0x1234), "movk w7, #0x1234"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 199 COMPARE(movk(x22, 0, 0), "movk x22, #0x0"); | 209 COMPARE(movk(x22, 0, 0), "movk x22, #0x0"); |
| 200 COMPARE(movk(w23, 0, 16), "movk w23, #0x0, lsl #16"); | 210 COMPARE(movk(w23, 0, 16), "movk w23, #0x0, lsl #16"); |
| 201 COMPARE(movk(x24, 0, 32), "movk x24, #0x0, lsl #32"); | 211 COMPARE(movk(x24, 0, 32), "movk x24, #0x0, lsl #32"); |
| 202 COMPARE(movk(x25, 0, 48), "movk x25, #0x0, lsl #48"); | 212 COMPARE(movk(x25, 0, 48), "movk x25, #0x0, lsl #48"); |
| 203 | 213 |
| 204 CLEANUP(); | 214 CLEANUP(); |
| 205 } | 215 } |
| 206 | 216 |
| 207 | 217 |
| 208 TEST(move_immediate_2) { | 218 TEST(move_immediate_2) { |
| 209 SET_UP_CLASS(MacroAssembler); | 219 SET_UP_MASM(); |
| 210 | 220 |
| 211 // Move instructions expected for certain immediates. This is really a macro | 221 // Move instructions expected for certain immediates. This is really a macro |
| 212 // assembler test, to ensure it generates immediates efficiently. | 222 // assembler test, to ensure it generates immediates efficiently. |
| 213 COMPARE(Mov(w0, 0), "movz w0, #0x0"); | 223 COMPARE(Mov(w0, 0), "movz w0, #0x0"); |
| 214 COMPARE(Mov(w0, 0x0000ffff), "movz w0, #0xffff"); | 224 COMPARE(Mov(w0, 0x0000ffff), "movz w0, #0xffff"); |
| 215 COMPARE(Mov(w0, 0x00010000), "movz w0, #0x10000"); | 225 COMPARE(Mov(w0, 0x00010000), "movz w0, #0x10000"); |
| 216 COMPARE(Mov(w0, 0xffff0000), "movz w0, #0xffff0000"); | 226 COMPARE(Mov(w0, 0xffff0000), "movz w0, #0xffff0000"); |
| 217 COMPARE(Mov(w0, 0x0001ffff), "movn w0, #0xfffe0000"); | 227 COMPARE(Mov(w0, 0x0001ffff), "movn w0, #0xfffe0000"); |
| 218 COMPARE(Mov(w0, 0xffff8000), "movn w0, #0x7fff"); | 228 COMPARE(Mov(w0, 0xffff8000), "movn w0, #0x7fff"); |
| 219 COMPARE(Mov(w0, 0xfffffffe), "movn w0, #0x1"); | 229 COMPARE(Mov(w0, 0xfffffffe), "movn w0, #0x1"); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 COMPARE(Movk(w2, 0x3456, 16), "movk w2, #0x3456, lsl #16"); | 265 COMPARE(Movk(w2, 0x3456, 16), "movk w2, #0x3456, lsl #16"); |
| 256 COMPARE(Movk(x3, 0x4567, 16), "movk x3, #0x4567, lsl #16"); | 266 COMPARE(Movk(x3, 0x4567, 16), "movk x3, #0x4567, lsl #16"); |
| 257 COMPARE(Movk(x4, 0x5678, 32), "movk x4, #0x5678, lsl #32"); | 267 COMPARE(Movk(x4, 0x5678, 32), "movk x4, #0x5678, lsl #32"); |
| 258 COMPARE(Movk(x5, 0x6789, 48), "movk x5, #0x6789, lsl #48"); | 268 COMPARE(Movk(x5, 0x6789, 48), "movk x5, #0x6789, lsl #48"); |
| 259 | 269 |
| 260 CLEANUP(); | 270 CLEANUP(); |
| 261 } | 271 } |
| 262 | 272 |
| 263 | 273 |
| 264 TEST_(add_immediate) { | 274 TEST_(add_immediate) { |
| 265 SET_UP(); | 275 SET_UP_ASM(); |
| 266 | 276 |
| 267 COMPARE(add(w0, w1, Operand(0xff)), "add w0, w1, #0xff (255)"); | 277 COMPARE(add(w0, w1, Operand(0xff)), "add w0, w1, #0xff (255)"); |
| 268 COMPARE(add(x2, x3, Operand(0x3ff)), "add x2, x3, #0x3ff (1023)"); | 278 COMPARE(add(x2, x3, Operand(0x3ff)), "add x2, x3, #0x3ff (1023)"); |
| 269 COMPARE(add(w4, w5, Operand(0xfff)), "add w4, w5, #0xfff (4095)"); | 279 COMPARE(add(w4, w5, Operand(0xfff)), "add w4, w5, #0xfff (4095)"); |
| 270 COMPARE(add(x6, x7, Operand(0x1000)), "add x6, x7, #0x1000 (4096)"); | 280 COMPARE(add(x6, x7, Operand(0x1000)), "add x6, x7, #0x1000 (4096)"); |
| 271 COMPARE(add(w8, w9, Operand(0xff000)), "add w8, w9, #0xff000 (1044480)"); | 281 COMPARE(add(w8, w9, Operand(0xff000)), "add w8, w9, #0xff000 (1044480)"); |
| 272 COMPARE(add(x10, x11, Operand(0x3ff000)), | 282 COMPARE(add(x10, x11, Operand(0x3ff000)), |
| 273 "add x10, x11, #0x3ff000 (4190208)"); | 283 "add x10, x11, #0x3ff000 (4190208)"); |
| 274 COMPARE(add(w12, w13, Operand(0xfff000)), | 284 COMPARE(add(w12, w13, Operand(0xfff000)), |
| 275 "add w12, w13, #0xfff000 (16773120)"); | 285 "add w12, w13, #0xfff000 (16773120)"); |
| 276 COMPARE(adds(w14, w15, Operand(0xff)), "adds w14, w15, #0xff (255)"); | 286 COMPARE(adds(w14, w15, Operand(0xff)), "adds w14, w15, #0xff (255)"); |
| 277 COMPARE(adds(x16, x17, Operand(0xaa000)), | 287 COMPARE(adds(x16, x17, Operand(0xaa000)), |
| 278 "adds x16, x17, #0xaa000 (696320)"); | 288 "adds x16, x17, #0xaa000 (696320)"); |
| 279 COMPARE(cmn(w18, Operand(0xff)), "cmn w18, #0xff (255)"); | 289 COMPARE(cmn(w18, Operand(0xff)), "cmn w18, #0xff (255)"); |
| 280 COMPARE(cmn(x19, Operand(0xff000)), "cmn x19, #0xff000 (1044480)"); | 290 COMPARE(cmn(x19, Operand(0xff000)), "cmn x19, #0xff000 (1044480)"); |
| 281 COMPARE(add(w0, wcsp, Operand(0)), "mov w0, wcsp"); | 291 COMPARE(add(w0, wcsp, Operand(0)), "mov w0, wcsp"); |
| 282 COMPARE(add(csp, x0, Operand(0)), "mov csp, x0"); | 292 COMPARE(add(csp, x0, Operand(0)), "mov csp, x0"); |
| 283 | 293 |
| 284 COMPARE(add(w1, wcsp, Operand(8)), "add w1, wcsp, #0x8 (8)"); | 294 COMPARE(add(w1, wcsp, Operand(8)), "add w1, wcsp, #0x8 (8)"); |
| 285 COMPARE(add(x2, csp, Operand(16)), "add x2, csp, #0x10 (16)"); | 295 COMPARE(add(x2, csp, Operand(16)), "add x2, csp, #0x10 (16)"); |
| 286 COMPARE(add(wcsp, wcsp, Operand(42)), "add wcsp, wcsp, #0x2a (42)"); | 296 COMPARE(add(wcsp, wcsp, Operand(42)), "add wcsp, wcsp, #0x2a (42)"); |
| 287 COMPARE(cmn(csp, Operand(24)), "cmn csp, #0x18 (24)"); | 297 COMPARE(cmn(csp, Operand(24)), "cmn csp, #0x18 (24)"); |
| 288 COMPARE(adds(wzr, wcsp, Operand(9)), "cmn wcsp, #0x9 (9)"); | 298 COMPARE(adds(wzr, wcsp, Operand(9)), "cmn wcsp, #0x9 (9)"); |
| 289 | 299 |
| 290 CLEANUP(); | 300 CLEANUP(); |
| 291 } | 301 } |
| 292 | 302 |
| 293 | 303 |
| 294 TEST_(sub_immediate) { | 304 TEST_(sub_immediate) { |
| 295 SET_UP(); | 305 SET_UP_ASM(); |
| 296 | 306 |
| 297 COMPARE(sub(w0, w1, Operand(0xff)), "sub w0, w1, #0xff (255)"); | 307 COMPARE(sub(w0, w1, Operand(0xff)), "sub w0, w1, #0xff (255)"); |
| 298 COMPARE(sub(x2, x3, Operand(0x3ff)), "sub x2, x3, #0x3ff (1023)"); | 308 COMPARE(sub(x2, x3, Operand(0x3ff)), "sub x2, x3, #0x3ff (1023)"); |
| 299 COMPARE(sub(w4, w5, Operand(0xfff)), "sub w4, w5, #0xfff (4095)"); | 309 COMPARE(sub(w4, w5, Operand(0xfff)), "sub w4, w5, #0xfff (4095)"); |
| 300 COMPARE(sub(x6, x7, Operand(0x1000)), "sub x6, x7, #0x1000 (4096)"); | 310 COMPARE(sub(x6, x7, Operand(0x1000)), "sub x6, x7, #0x1000 (4096)"); |
| 301 COMPARE(sub(w8, w9, Operand(0xff000)), "sub w8, w9, #0xff000 (1044480)"); | 311 COMPARE(sub(w8, w9, Operand(0xff000)), "sub w8, w9, #0xff000 (1044480)"); |
| 302 COMPARE(sub(x10, x11, Operand(0x3ff000)), | 312 COMPARE(sub(x10, x11, Operand(0x3ff000)), |
| 303 "sub x10, x11, #0x3ff000 (4190208)"); | 313 "sub x10, x11, #0x3ff000 (4190208)"); |
| 304 COMPARE(sub(w12, w13, Operand(0xfff000)), | 314 COMPARE(sub(w12, w13, Operand(0xfff000)), |
| 305 "sub w12, w13, #0xfff000 (16773120)"); | 315 "sub w12, w13, #0xfff000 (16773120)"); |
| 306 COMPARE(subs(w14, w15, Operand(0xff)), "subs w14, w15, #0xff (255)"); | 316 COMPARE(subs(w14, w15, Operand(0xff)), "subs w14, w15, #0xff (255)"); |
| 307 COMPARE(subs(x16, x17, Operand(0xaa000)), | 317 COMPARE(subs(x16, x17, Operand(0xaa000)), |
| 308 "subs x16, x17, #0xaa000 (696320)"); | 318 "subs x16, x17, #0xaa000 (696320)"); |
| 309 COMPARE(cmp(w18, Operand(0xff)), "cmp w18, #0xff (255)"); | 319 COMPARE(cmp(w18, Operand(0xff)), "cmp w18, #0xff (255)"); |
| 310 COMPARE(cmp(x19, Operand(0xff000)), "cmp x19, #0xff000 (1044480)"); | 320 COMPARE(cmp(x19, Operand(0xff000)), "cmp x19, #0xff000 (1044480)"); |
| 311 | 321 |
| 312 COMPARE(add(w1, wcsp, Operand(8)), "add w1, wcsp, #0x8 (8)"); | 322 COMPARE(add(w1, wcsp, Operand(8)), "add w1, wcsp, #0x8 (8)"); |
| 313 COMPARE(add(x2, csp, Operand(16)), "add x2, csp, #0x10 (16)"); | 323 COMPARE(add(x2, csp, Operand(16)), "add x2, csp, #0x10 (16)"); |
| 314 COMPARE(add(wcsp, wcsp, Operand(42)), "add wcsp, wcsp, #0x2a (42)"); | 324 COMPARE(add(wcsp, wcsp, Operand(42)), "add wcsp, wcsp, #0x2a (42)"); |
| 315 COMPARE(cmn(csp, Operand(24)), "cmn csp, #0x18 (24)"); | 325 COMPARE(cmn(csp, Operand(24)), "cmn csp, #0x18 (24)"); |
| 316 COMPARE(adds(wzr, wcsp, Operand(9)), "cmn wcsp, #0x9 (9)"); | 326 COMPARE(adds(wzr, wcsp, Operand(9)), "cmn wcsp, #0x9 (9)"); |
| 317 | 327 |
| 318 CLEANUP(); | 328 CLEANUP(); |
| 319 } | 329 } |
| 320 | 330 |
| 321 | 331 |
| 322 TEST_(add_shifted) { | 332 TEST_(add_shifted) { |
| 323 SET_UP(); | 333 SET_UP_ASM(); |
| 324 | 334 |
| 325 COMPARE(add(w0, w1, Operand(w2)), "add w0, w1, w2"); | 335 COMPARE(add(w0, w1, Operand(w2)), "add w0, w1, w2"); |
| 326 COMPARE(add(x3, x4, Operand(x5)), "add x3, x4, x5"); | 336 COMPARE(add(x3, x4, Operand(x5)), "add x3, x4, x5"); |
| 327 COMPARE(add(w6, w7, Operand(w8, LSL, 1)), "add w6, w7, w8, lsl #1"); | 337 COMPARE(add(w6, w7, Operand(w8, LSL, 1)), "add w6, w7, w8, lsl #1"); |
| 328 COMPARE(add(x9, x10, Operand(x11, LSL, 2)), "add x9, x10, x11, lsl #2"); | 338 COMPARE(add(x9, x10, Operand(x11, LSL, 2)), "add x9, x10, x11, lsl #2"); |
| 329 COMPARE(add(w12, w13, Operand(w14, LSR, 3)), "add w12, w13, w14, lsr #3"); | 339 COMPARE(add(w12, w13, Operand(w14, LSR, 3)), "add w12, w13, w14, lsr #3"); |
| 330 COMPARE(add(x15, x16, Operand(x17, LSR, 4)), "add x15, x16, x17, lsr #4"); | 340 COMPARE(add(x15, x16, Operand(x17, LSR, 4)), "add x15, x16, x17, lsr #4"); |
| 331 COMPARE(add(w18, w19, Operand(w20, ASR, 5)), "add w18, w19, w20, asr #5"); | 341 COMPARE(add(w18, w19, Operand(w20, ASR, 5)), "add w18, w19, w20, asr #5"); |
| 332 COMPARE(add(x21, x22, Operand(x23, ASR, 6)), "add x21, x22, x23, asr #6"); | 342 COMPARE(add(x21, x22, Operand(x23, ASR, 6)), "add x21, x22, x23, asr #6"); |
| 333 COMPARE(cmn(w24, Operand(w25)), "cmn w24, w25"); | 343 COMPARE(cmn(w24, Operand(w25)), "cmn w24, w25"); |
| 334 COMPARE(cmn(x26, Operand(cp, LSL, 63)), "cmn x26, cp, lsl #63"); | 344 COMPARE(cmn(x26, Operand(cp, LSL, 63)), "cmn x26, cp, lsl #63"); |
| 335 | 345 |
| 336 COMPARE(add(x0, csp, Operand(x1)), "add x0, csp, x1"); | 346 COMPARE(add(x0, csp, Operand(x1)), "add x0, csp, x1"); |
| 337 COMPARE(add(w2, wcsp, Operand(w3)), "add w2, wcsp, w3"); | 347 COMPARE(add(w2, wcsp, Operand(w3)), "add w2, wcsp, w3"); |
| 338 COMPARE(add(x4, csp, Operand(x5, LSL, 1)), "add x4, csp, x5, lsl #1"); | 348 COMPARE(add(x4, csp, Operand(x5, LSL, 1)), "add x4, csp, x5, lsl #1"); |
| 339 COMPARE(add(x4, xzr, Operand(x5, LSL, 1)), "add x4, xzr, x5, lsl #1"); | 349 COMPARE(add(x4, xzr, Operand(x5, LSL, 1)), "add x4, xzr, x5, lsl #1"); |
| 340 COMPARE(add(w6, wcsp, Operand(w7, LSL, 3)), "add w6, wcsp, w7, lsl #3"); | 350 COMPARE(add(w6, wcsp, Operand(w7, LSL, 3)), "add w6, wcsp, w7, lsl #3"); |
| 341 COMPARE(adds(xzr, csp, Operand(x8, LSL, 4)), "cmn csp, x8, lsl #4"); | 351 COMPARE(adds(xzr, csp, Operand(x8, LSL, 4)), "cmn csp, x8, lsl #4"); |
| 342 COMPARE(adds(xzr, xzr, Operand(x8, LSL, 5)), "cmn xzr, x8, lsl #5"); | 352 COMPARE(adds(xzr, xzr, Operand(x8, LSL, 5)), "cmn xzr, x8, lsl #5"); |
| 343 | 353 |
| 344 CLEANUP(); | 354 CLEANUP(); |
| 345 } | 355 } |
| 346 | 356 |
| 347 | 357 |
| 348 TEST_(sub_shifted) { | 358 TEST_(sub_shifted) { |
| 349 SET_UP(); | 359 SET_UP_ASM(); |
| 350 | 360 |
| 351 COMPARE(sub(w0, w1, Operand(w2)), "sub w0, w1, w2"); | 361 COMPARE(sub(w0, w1, Operand(w2)), "sub w0, w1, w2"); |
| 352 COMPARE(sub(x3, x4, Operand(x5)), "sub x3, x4, x5"); | 362 COMPARE(sub(x3, x4, Operand(x5)), "sub x3, x4, x5"); |
| 353 COMPARE(sub(w6, w7, Operand(w8, LSL, 1)), "sub w6, w7, w8, lsl #1"); | 363 COMPARE(sub(w6, w7, Operand(w8, LSL, 1)), "sub w6, w7, w8, lsl #1"); |
| 354 COMPARE(sub(x9, x10, Operand(x11, LSL, 2)), "sub x9, x10, x11, lsl #2"); | 364 COMPARE(sub(x9, x10, Operand(x11, LSL, 2)), "sub x9, x10, x11, lsl #2"); |
| 355 COMPARE(sub(w12, w13, Operand(w14, LSR, 3)), "sub w12, w13, w14, lsr #3"); | 365 COMPARE(sub(w12, w13, Operand(w14, LSR, 3)), "sub w12, w13, w14, lsr #3"); |
| 356 COMPARE(sub(x15, x16, Operand(x17, LSR, 4)), "sub x15, x16, x17, lsr #4"); | 366 COMPARE(sub(x15, x16, Operand(x17, LSR, 4)), "sub x15, x16, x17, lsr #4"); |
| 357 COMPARE(sub(w18, w19, Operand(w20, ASR, 5)), "sub w18, w19, w20, asr #5"); | 367 COMPARE(sub(w18, w19, Operand(w20, ASR, 5)), "sub w18, w19, w20, asr #5"); |
| 358 COMPARE(sub(x21, x22, Operand(x23, ASR, 6)), "sub x21, x22, x23, asr #6"); | 368 COMPARE(sub(x21, x22, Operand(x23, ASR, 6)), "sub x21, x22, x23, asr #6"); |
| 359 COMPARE(cmp(w24, Operand(w25)), "cmp w24, w25"); | 369 COMPARE(cmp(w24, Operand(w25)), "cmp w24, w25"); |
| 360 COMPARE(cmp(x26, Operand(cp, LSL, 63)), "cmp x26, cp, lsl #63"); | 370 COMPARE(cmp(x26, Operand(cp, LSL, 63)), "cmp x26, cp, lsl #63"); |
| 361 COMPARE(neg(w28, Operand(w29)), "neg w28, w29"); | 371 COMPARE(neg(w28, Operand(w29)), "neg w28, w29"); |
| 362 COMPARE(neg(lr, Operand(x0, LSR, 62)), "neg lr, x0, lsr #62"); | 372 COMPARE(neg(lr, Operand(x0, LSR, 62)), "neg lr, x0, lsr #62"); |
| 363 COMPARE(negs(w1, Operand(w2)), "negs w1, w2"); | 373 COMPARE(negs(w1, Operand(w2)), "negs w1, w2"); |
| 364 COMPARE(negs(x3, Operand(x4, ASR, 61)), "negs x3, x4, asr #61"); | 374 COMPARE(negs(x3, Operand(x4, ASR, 61)), "negs x3, x4, asr #61"); |
| 365 | 375 |
| 366 COMPARE(sub(x0, csp, Operand(x1)), "sub x0, csp, x1"); | 376 COMPARE(sub(x0, csp, Operand(x1)), "sub x0, csp, x1"); |
| 367 COMPARE(sub(w2, wcsp, Operand(w3)), "sub w2, wcsp, w3"); | 377 COMPARE(sub(w2, wcsp, Operand(w3)), "sub w2, wcsp, w3"); |
| 368 COMPARE(sub(x4, csp, Operand(x5, LSL, 1)), "sub x4, csp, x5, lsl #1"); | 378 COMPARE(sub(x4, csp, Operand(x5, LSL, 1)), "sub x4, csp, x5, lsl #1"); |
| 369 COMPARE(sub(x4, xzr, Operand(x5, LSL, 1)), "neg x4, x5, lsl #1"); | 379 COMPARE(sub(x4, xzr, Operand(x5, LSL, 1)), "neg x4, x5, lsl #1"); |
| 370 COMPARE(sub(w6, wcsp, Operand(w7, LSL, 3)), "sub w6, wcsp, w7, lsl #3"); | 380 COMPARE(sub(w6, wcsp, Operand(w7, LSL, 3)), "sub w6, wcsp, w7, lsl #3"); |
| 371 COMPARE(subs(xzr, csp, Operand(x8, LSL, 4)), "cmp csp, x8, lsl #4"); | 381 COMPARE(subs(xzr, csp, Operand(x8, LSL, 4)), "cmp csp, x8, lsl #4"); |
| 372 COMPARE(subs(xzr, xzr, Operand(x8, LSL, 5)), "cmp xzr, x8, lsl #5"); | 382 COMPARE(subs(xzr, xzr, Operand(x8, LSL, 5)), "cmp xzr, x8, lsl #5"); |
| 373 | 383 |
| 374 CLEANUP(); | 384 CLEANUP(); |
| 375 } | 385 } |
| 376 | 386 |
| 377 | 387 |
| 378 TEST_(add_extended) { | 388 TEST_(add_extended) { |
| 379 SET_UP(); | 389 SET_UP_ASM(); |
| 380 | 390 |
| 381 COMPARE(add(w0, w1, Operand(w2, UXTB)), "add w0, w1, w2, uxtb"); | 391 COMPARE(add(w0, w1, Operand(w2, UXTB)), "add w0, w1, w2, uxtb"); |
| 382 COMPARE(adds(x3, x4, Operand(w5, UXTB, 1)), "adds x3, x4, w5, uxtb #1"); | 392 COMPARE(adds(x3, x4, Operand(w5, UXTB, 1)), "adds x3, x4, w5, uxtb #1"); |
| 383 COMPARE(add(w6, w7, Operand(w8, UXTH, 2)), "add w6, w7, w8, uxth #2"); | 393 COMPARE(add(w6, w7, Operand(w8, UXTH, 2)), "add w6, w7, w8, uxth #2"); |
| 384 COMPARE(adds(x9, x10, Operand(x11, UXTW, 3)), "adds x9, x10, w11, uxtw #3"); | 394 COMPARE(adds(x9, x10, Operand(x11, UXTW, 3)), "adds x9, x10, w11, uxtw #3"); |
| 385 COMPARE(add(x12, x13, Operand(x14, UXTX, 4)), "add x12, x13, x14, uxtx #4"); | 395 COMPARE(add(x12, x13, Operand(x14, UXTX, 4)), "add x12, x13, x14, uxtx #4"); |
| 386 COMPARE(adds(w15, w16, Operand(w17, SXTB, 4)), "adds w15, w16, w17, sxtb #4"); | 396 COMPARE(adds(w15, w16, Operand(w17, SXTB, 4)), "adds w15, w16, w17, sxtb #4"); |
| 387 COMPARE(add(x18, x19, Operand(x20, SXTB, 3)), "add x18, x19, w20, sxtb #3"); | 397 COMPARE(add(x18, x19, Operand(x20, SXTB, 3)), "add x18, x19, w20, sxtb #3"); |
| 388 COMPARE(adds(w21, w22, Operand(w23, SXTH, 2)), "adds w21, w22, w23, sxth #2"); | 398 COMPARE(adds(w21, w22, Operand(w23, SXTH, 2)), "adds w21, w22, w23, sxth #2"); |
| 389 COMPARE(add(x24, x25, Operand(x26, SXTW, 1)), "add x24, x25, w26, sxtw #1"); | 399 COMPARE(add(x24, x25, Operand(x26, SXTW, 1)), "add x24, x25, w26, sxtw #1"); |
| 390 COMPARE(adds(cp, jssp, Operand(fp, SXTX)), "adds cp, jssp, fp, sxtx"); | 400 COMPARE(adds(cp, jssp, Operand(fp, SXTX)), "adds cp, jssp, fp, sxtx"); |
| 391 COMPARE(cmn(w0, Operand(w1, UXTB, 2)), "cmn w0, w1, uxtb #2"); | 401 COMPARE(cmn(w0, Operand(w1, UXTB, 2)), "cmn w0, w1, uxtb #2"); |
| 392 COMPARE(cmn(x2, Operand(x3, SXTH, 4)), "cmn x2, w3, sxth #4"); | 402 COMPARE(cmn(x2, Operand(x3, SXTH, 4)), "cmn x2, w3, sxth #4"); |
| 393 | 403 |
| 394 COMPARE(add(w0, wcsp, Operand(w1, UXTB)), "add w0, wcsp, w1, uxtb"); | 404 COMPARE(add(w0, wcsp, Operand(w1, UXTB)), "add w0, wcsp, w1, uxtb"); |
| 395 COMPARE(add(x2, csp, Operand(x3, UXTH, 1)), "add x2, csp, w3, uxth #1"); | 405 COMPARE(add(x2, csp, Operand(x3, UXTH, 1)), "add x2, csp, w3, uxth #1"); |
| 396 COMPARE(add(wcsp, wcsp, Operand(w4, UXTW, 2)), "add wcsp, wcsp, w4, lsl #2"); | 406 COMPARE(add(wcsp, wcsp, Operand(w4, UXTW, 2)), "add wcsp, wcsp, w4, lsl #2"); |
| 397 COMPARE(cmn(csp, Operand(xzr, UXTX, 3)), "cmn csp, xzr, lsl #3"); | 407 COMPARE(cmn(csp, Operand(xzr, UXTX, 3)), "cmn csp, xzr, lsl #3"); |
| 398 COMPARE(cmn(csp, Operand(xzr, LSL, 4)), "cmn csp, xzr, lsl #4"); | 408 COMPARE(cmn(csp, Operand(xzr, LSL, 4)), "cmn csp, xzr, lsl #4"); |
| 399 | 409 |
| 400 CLEANUP(); | 410 CLEANUP(); |
| 401 } | 411 } |
| 402 | 412 |
| 403 | 413 |
| 404 TEST_(sub_extended) { | 414 TEST_(sub_extended) { |
| 405 SET_UP(); | 415 SET_UP_ASM(); |
| 406 | 416 |
| 407 COMPARE(sub(w0, w1, Operand(w2, UXTB)), "sub w0, w1, w2, uxtb"); | 417 COMPARE(sub(w0, w1, Operand(w2, UXTB)), "sub w0, w1, w2, uxtb"); |
| 408 COMPARE(subs(x3, x4, Operand(w5, UXTB, 1)), "subs x3, x4, w5, uxtb #1"); | 418 COMPARE(subs(x3, x4, Operand(w5, UXTB, 1)), "subs x3, x4, w5, uxtb #1"); |
| 409 COMPARE(sub(w6, w7, Operand(w8, UXTH, 2)), "sub w6, w7, w8, uxth #2"); | 419 COMPARE(sub(w6, w7, Operand(w8, UXTH, 2)), "sub w6, w7, w8, uxth #2"); |
| 410 COMPARE(subs(x9, x10, Operand(x11, UXTW, 3)), "subs x9, x10, w11, uxtw #3"); | 420 COMPARE(subs(x9, x10, Operand(x11, UXTW, 3)), "subs x9, x10, w11, uxtw #3"); |
| 411 COMPARE(sub(x12, x13, Operand(x14, UXTX, 4)), "sub x12, x13, x14, uxtx #4"); | 421 COMPARE(sub(x12, x13, Operand(x14, UXTX, 4)), "sub x12, x13, x14, uxtx #4"); |
| 412 COMPARE(subs(w15, w16, Operand(w17, SXTB, 4)), "subs w15, w16, w17, sxtb #4"); | 422 COMPARE(subs(w15, w16, Operand(w17, SXTB, 4)), "subs w15, w16, w17, sxtb #4"); |
| 413 COMPARE(sub(x18, x19, Operand(x20, SXTB, 3)), "sub x18, x19, w20, sxtb #3"); | 423 COMPARE(sub(x18, x19, Operand(x20, SXTB, 3)), "sub x18, x19, w20, sxtb #3"); |
| 414 COMPARE(subs(w21, w22, Operand(w23, SXTH, 2)), "subs w21, w22, w23, sxth #2"); | 424 COMPARE(subs(w21, w22, Operand(w23, SXTH, 2)), "subs w21, w22, w23, sxth #2"); |
| 415 COMPARE(sub(x24, x25, Operand(x26, SXTW, 1)), "sub x24, x25, w26, sxtw #1"); | 425 COMPARE(sub(x24, x25, Operand(x26, SXTW, 1)), "sub x24, x25, w26, sxtw #1"); |
| 416 COMPARE(subs(cp, jssp, Operand(fp, SXTX)), "subs cp, jssp, fp, sxtx"); | 426 COMPARE(subs(cp, jssp, Operand(fp, SXTX)), "subs cp, jssp, fp, sxtx"); |
| 417 COMPARE(cmp(w0, Operand(w1, SXTB, 1)), "cmp w0, w1, sxtb #1"); | 427 COMPARE(cmp(w0, Operand(w1, SXTB, 1)), "cmp w0, w1, sxtb #1"); |
| 418 COMPARE(cmp(x2, Operand(x3, UXTH, 3)), "cmp x2, w3, uxth #3"); | 428 COMPARE(cmp(x2, Operand(x3, UXTH, 3)), "cmp x2, w3, uxth #3"); |
| 419 | 429 |
| 420 COMPARE(sub(w0, wcsp, Operand(w1, UXTB)), "sub w0, wcsp, w1, uxtb"); | 430 COMPARE(sub(w0, wcsp, Operand(w1, UXTB)), "sub w0, wcsp, w1, uxtb"); |
| 421 COMPARE(sub(x2, csp, Operand(x3, UXTH, 1)), "sub x2, csp, w3, uxth #1"); | 431 COMPARE(sub(x2, csp, Operand(x3, UXTH, 1)), "sub x2, csp, w3, uxth #1"); |
| 422 COMPARE(sub(wcsp, wcsp, Operand(w4, UXTW, 2)), "sub wcsp, wcsp, w4, lsl #2"); | 432 COMPARE(sub(wcsp, wcsp, Operand(w4, UXTW, 2)), "sub wcsp, wcsp, w4, lsl #2"); |
| 423 COMPARE(cmp(csp, Operand(xzr, UXTX, 3)), "cmp csp, xzr, lsl #3"); | 433 COMPARE(cmp(csp, Operand(xzr, UXTX, 3)), "cmp csp, xzr, lsl #3"); |
| 424 COMPARE(cmp(csp, Operand(xzr, LSL, 4)), "cmp csp, xzr, lsl #4"); | 434 COMPARE(cmp(csp, Operand(xzr, LSL, 4)), "cmp csp, xzr, lsl #4"); |
| 425 | 435 |
| 426 CLEANUP(); | 436 CLEANUP(); |
| 427 } | 437 } |
| 428 | 438 |
| 429 | 439 |
| 430 TEST_(adc_subc_ngc) { | 440 TEST_(adc_subc_ngc) { |
| 431 SET_UP(); | 441 SET_UP_ASM(); |
| 432 | 442 |
| 433 COMPARE(adc(w0, w1, Operand(w2)), "adc w0, w1, w2"); | 443 COMPARE(adc(w0, w1, Operand(w2)), "adc w0, w1, w2"); |
| 434 COMPARE(adc(x3, x4, Operand(x5)), "adc x3, x4, x5"); | 444 COMPARE(adc(x3, x4, Operand(x5)), "adc x3, x4, x5"); |
| 435 COMPARE(adcs(w6, w7, Operand(w8)), "adcs w6, w7, w8"); | 445 COMPARE(adcs(w6, w7, Operand(w8)), "adcs w6, w7, w8"); |
| 436 COMPARE(adcs(x9, x10, Operand(x11)), "adcs x9, x10, x11"); | 446 COMPARE(adcs(x9, x10, Operand(x11)), "adcs x9, x10, x11"); |
| 437 COMPARE(sbc(w12, w13, Operand(w14)), "sbc w12, w13, w14"); | 447 COMPARE(sbc(w12, w13, Operand(w14)), "sbc w12, w13, w14"); |
| 438 COMPARE(sbc(x15, x16, Operand(x17)), "sbc x15, x16, x17"); | 448 COMPARE(sbc(x15, x16, Operand(x17)), "sbc x15, x16, x17"); |
| 439 COMPARE(sbcs(w18, w19, Operand(w20)), "sbcs w18, w19, w20"); | 449 COMPARE(sbcs(w18, w19, Operand(w20)), "sbcs w18, w19, w20"); |
| 440 COMPARE(sbcs(x21, x22, Operand(x23)), "sbcs x21, x22, x23"); | 450 COMPARE(sbcs(x21, x22, Operand(x23)), "sbcs x21, x22, x23"); |
| 441 COMPARE(ngc(w24, Operand(w25)), "ngc w24, w25"); | 451 COMPARE(ngc(w24, Operand(w25)), "ngc w24, w25"); |
| 442 COMPARE(ngc(x26, Operand(cp)), "ngc x26, cp"); | 452 COMPARE(ngc(x26, Operand(cp)), "ngc x26, cp"); |
| 443 COMPARE(ngcs(w28, Operand(w29)), "ngcs w28, w29"); | 453 COMPARE(ngcs(w28, Operand(w29)), "ngcs w28, w29"); |
| 444 COMPARE(ngcs(lr, Operand(x0)), "ngcs lr, x0"); | 454 COMPARE(ngcs(lr, Operand(x0)), "ngcs lr, x0"); |
| 445 | 455 |
| 446 CLEANUP(); | 456 CLEANUP(); |
| 447 } | 457 } |
| 448 | 458 |
| 449 | 459 |
| 450 TEST_(mul_and_div) { | 460 TEST_(mul_and_div) { |
| 451 SET_UP(); | 461 SET_UP_ASM(); |
| 452 | 462 |
| 453 COMPARE(mul(w0, w1, w2), "mul w0, w1, w2"); | 463 COMPARE(mul(w0, w1, w2), "mul w0, w1, w2"); |
| 454 COMPARE(mul(x3, x4, x5), "mul x3, x4, x5"); | 464 COMPARE(mul(x3, x4, x5), "mul x3, x4, x5"); |
| 455 COMPARE(mul(w30, w0, w1), "mul w30, w0, w1"); | 465 COMPARE(mul(w30, w0, w1), "mul w30, w0, w1"); |
| 456 COMPARE(mul(lr, x0, x1), "mul lr, x0, x1"); | 466 COMPARE(mul(lr, x0, x1), "mul lr, x0, x1"); |
| 457 COMPARE(mneg(w0, w1, w2), "mneg w0, w1, w2"); | 467 COMPARE(mneg(w0, w1, w2), "mneg w0, w1, w2"); |
| 458 COMPARE(mneg(x3, x4, x5), "mneg x3, x4, x5"); | 468 COMPARE(mneg(x3, x4, x5), "mneg x3, x4, x5"); |
| 459 COMPARE(mneg(w30, w0, w1), "mneg w30, w0, w1"); | 469 COMPARE(mneg(w30, w0, w1), "mneg w30, w0, w1"); |
| 460 COMPARE(mneg(lr, x0, x1), "mneg lr, x0, x1"); | 470 COMPARE(mneg(lr, x0, x1), "mneg lr, x0, x1"); |
| 461 COMPARE(smull(x0, w0, w1), "smull x0, w0, w1"); | 471 COMPARE(smull(x0, w0, w1), "smull x0, w0, w1"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 474 COMPARE(sdiv(w0, w1, w2), "sdiv w0, w1, w2"); | 484 COMPARE(sdiv(w0, w1, w2), "sdiv w0, w1, w2"); |
| 475 COMPARE(sdiv(x3, x4, x5), "sdiv x3, x4, x5"); | 485 COMPARE(sdiv(x3, x4, x5), "sdiv x3, x4, x5"); |
| 476 COMPARE(udiv(w6, w7, w8), "udiv w6, w7, w8"); | 486 COMPARE(udiv(w6, w7, w8), "udiv w6, w7, w8"); |
| 477 COMPARE(udiv(x9, x10, x11), "udiv x9, x10, x11"); | 487 COMPARE(udiv(x9, x10, x11), "udiv x9, x10, x11"); |
| 478 | 488 |
| 479 CLEANUP(); | 489 CLEANUP(); |
| 480 } | 490 } |
| 481 | 491 |
| 482 | 492 |
| 483 TEST(maddl_msubl) { | 493 TEST(maddl_msubl) { |
| 484 SET_UP(); | 494 SET_UP_ASM(); |
| 485 | 495 |
| 486 COMPARE(smaddl(x0, w1, w2, x3), "smaddl x0, w1, w2, x3"); | 496 COMPARE(smaddl(x0, w1, w2, x3), "smaddl x0, w1, w2, x3"); |
| 487 COMPARE(smaddl(x25, w21, w22, x16), "smaddl x25, w21, w22, x16"); | 497 COMPARE(smaddl(x25, w21, w22, x16), "smaddl x25, w21, w22, x16"); |
| 488 COMPARE(umaddl(x0, w1, w2, x3), "umaddl x0, w1, w2, x3"); | 498 COMPARE(umaddl(x0, w1, w2, x3), "umaddl x0, w1, w2, x3"); |
| 489 COMPARE(umaddl(x25, w21, w22, x16), "umaddl x25, w21, w22, x16"); | 499 COMPARE(umaddl(x25, w21, w22, x16), "umaddl x25, w21, w22, x16"); |
| 490 | 500 |
| 491 COMPARE(smsubl(x0, w1, w2, x3), "smsubl x0, w1, w2, x3"); | 501 COMPARE(smsubl(x0, w1, w2, x3), "smsubl x0, w1, w2, x3"); |
| 492 COMPARE(smsubl(x25, w21, w22, x16), "smsubl x25, w21, w22, x16"); | 502 COMPARE(smsubl(x25, w21, w22, x16), "smsubl x25, w21, w22, x16"); |
| 493 COMPARE(umsubl(x0, w1, w2, x3), "umsubl x0, w1, w2, x3"); | 503 COMPARE(umsubl(x0, w1, w2, x3), "umsubl x0, w1, w2, x3"); |
| 494 COMPARE(umsubl(x25, w21, w22, x16), "umsubl x25, w21, w22, x16"); | 504 COMPARE(umsubl(x25, w21, w22, x16), "umsubl x25, w21, w22, x16"); |
| 495 | 505 |
| 496 CLEANUP(); | 506 CLEANUP(); |
| 497 } | 507 } |
| 498 | 508 |
| 499 | 509 |
| 500 TEST_(dp_1_source) { | 510 TEST_(dp_1_source) { |
| 501 SET_UP(); | 511 SET_UP_ASM(); |
| 502 | 512 |
| 503 COMPARE(rbit(w0, w1), "rbit w0, w1"); | 513 COMPARE(rbit(w0, w1), "rbit w0, w1"); |
| 504 COMPARE(rbit(x2, x3), "rbit x2, x3"); | 514 COMPARE(rbit(x2, x3), "rbit x2, x3"); |
| 505 COMPARE(rev16(w4, w5), "rev16 w4, w5"); | 515 COMPARE(rev16(w4, w5), "rev16 w4, w5"); |
| 506 COMPARE(rev16(x6, x7), "rev16 x6, x7"); | 516 COMPARE(rev16(x6, x7), "rev16 x6, x7"); |
| 507 COMPARE(rev32(x8, x9), "rev32 x8, x9"); | 517 COMPARE(rev32(x8, x9), "rev32 x8, x9"); |
| 508 COMPARE(rev(w10, w11), "rev w10, w11"); | 518 COMPARE(rev(w10, w11), "rev w10, w11"); |
| 509 COMPARE(rev(x12, x13), "rev x12, x13"); | 519 COMPARE(rev(x12, x13), "rev x12, x13"); |
| 510 COMPARE(clz(w14, w15), "clz w14, w15"); | 520 COMPARE(clz(w14, w15), "clz w14, w15"); |
| 511 COMPARE(clz(x16, x17), "clz x16, x17"); | 521 COMPARE(clz(x16, x17), "clz x16, x17"); |
| 512 COMPARE(cls(w18, w19), "cls w18, w19"); | 522 COMPARE(cls(w18, w19), "cls w18, w19"); |
| 513 COMPARE(cls(x20, x21), "cls x20, x21"); | 523 COMPARE(cls(x20, x21), "cls x20, x21"); |
| 514 | 524 |
| 515 CLEANUP(); | 525 CLEANUP(); |
| 516 } | 526 } |
| 517 | 527 |
| 518 | 528 |
| 519 TEST_(bitfield) { | 529 TEST_(bitfield) { |
| 520 SET_UP(); | 530 SET_UP_ASM(); |
| 521 | 531 |
| 522 COMPARE(sxtb(w0, w1), "sxtb w0, w1"); | 532 COMPARE(sxtb(w0, w1), "sxtb w0, w1"); |
| 523 COMPARE(sxtb(x2, x3), "sxtb x2, w3"); | 533 COMPARE(sxtb(x2, x3), "sxtb x2, w3"); |
| 524 COMPARE(sxth(w4, w5), "sxth w4, w5"); | 534 COMPARE(sxth(w4, w5), "sxth w4, w5"); |
| 525 COMPARE(sxth(x6, x7), "sxth x6, w7"); | 535 COMPARE(sxth(x6, x7), "sxth x6, w7"); |
| 526 COMPARE(sxtw(x8, x9), "sxtw x8, w9"); | 536 COMPARE(sxtw(x8, x9), "sxtw x8, w9"); |
| 527 COMPARE(sxtb(x0, w1), "sxtb x0, w1"); | 537 COMPARE(sxtb(x0, w1), "sxtb x0, w1"); |
| 528 COMPARE(sxth(x2, w3), "sxth x2, w3"); | 538 COMPARE(sxth(x2, w3), "sxth x2, w3"); |
| 529 COMPARE(sxtw(x4, w5), "sxtw x4, w5"); | 539 COMPARE(sxtw(x4, w5), "sxtw x4, w5"); |
| 530 | 540 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 552 COMPARE(ubfiz(w17, w18, 9, 12), "ubfiz w17, w18, #9, #12"); | 562 COMPARE(ubfiz(w17, w18, 9, 12), "ubfiz w17, w18, #9, #12"); |
| 553 COMPARE(ubfiz(x19, x20, 10, 11), "ubfiz x19, x20, #10, #11"); | 563 COMPARE(ubfiz(x19, x20, 10, 11), "ubfiz x19, x20, #10, #11"); |
| 554 COMPARE(ubfx(w21, w22, 11, 10), "ubfx w21, w22, #11, #10"); | 564 COMPARE(ubfx(w21, w22, 11, 10), "ubfx w21, w22, #11, #10"); |
| 555 COMPARE(ubfx(x23, x24, 12, 9), "ubfx x23, x24, #12, #9"); | 565 COMPARE(ubfx(x23, x24, 12, 9), "ubfx x23, x24, #12, #9"); |
| 556 | 566 |
| 557 CLEANUP(); | 567 CLEANUP(); |
| 558 } | 568 } |
| 559 | 569 |
| 560 | 570 |
| 561 TEST_(extract) { | 571 TEST_(extract) { |
| 562 SET_UP(); | 572 SET_UP_ASM(); |
| 563 | 573 |
| 564 COMPARE(extr(w0, w1, w2, 0), "extr w0, w1, w2, #0"); | 574 COMPARE(extr(w0, w1, w2, 0), "extr w0, w1, w2, #0"); |
| 565 COMPARE(extr(x3, x4, x5, 1), "extr x3, x4, x5, #1"); | 575 COMPARE(extr(x3, x4, x5, 1), "extr x3, x4, x5, #1"); |
| 566 COMPARE(extr(w6, w7, w8, 31), "extr w6, w7, w8, #31"); | 576 COMPARE(extr(w6, w7, w8, 31), "extr w6, w7, w8, #31"); |
| 567 COMPARE(extr(x9, x10, x11, 63), "extr x9, x10, x11, #63"); | 577 COMPARE(extr(x9, x10, x11, 63), "extr x9, x10, x11, #63"); |
| 568 COMPARE(extr(w12, w13, w13, 10), "ror w12, w13, #10"); | 578 COMPARE(extr(w12, w13, w13, 10), "ror w12, w13, #10"); |
| 569 COMPARE(extr(x14, x15, x15, 42), "ror x14, x15, #42"); | 579 COMPARE(extr(x14, x15, x15, 42), "ror x14, x15, #42"); |
| 570 | 580 |
| 571 CLEANUP(); | 581 CLEANUP(); |
| 572 } | 582 } |
| 573 | 583 |
| 574 | 584 |
| 575 TEST_(logical_immediate) { | 585 TEST_(logical_immediate) { |
| 576 SET_UP(); | 586 SET_UP_ASM(); |
| 577 #define RESULT_SIZE (256) | 587 #define RESULT_SIZE (256) |
| 578 | 588 |
| 579 char result[RESULT_SIZE]; | 589 char result[RESULT_SIZE]; |
| 580 | 590 |
| 581 // Test immediate encoding - 64-bit destination. | 591 // Test immediate encoding - 64-bit destination. |
| 582 // 64-bit patterns. | 592 // 64-bit patterns. |
| 583 uint64_t value = 0x7fffffff; | 593 uint64_t value = 0x7fffffff; |
| 584 for (int i = 0; i < 64; i++) { | 594 for (int i = 0; i < 64; i++) { |
| 585 snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value); | 595 snprintf(result, RESULT_SIZE, "and x0, x0, #0x%" PRIx64, value); |
| 586 COMPARE(and_(x0, x0, Operand(value)), result); | 596 COMPARE(and_(x0, x0, Operand(value)), result); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 COMPARE(orr(x8, xzr, Operand(0xfffffffffc001fffUL)), | 702 COMPARE(orr(x8, xzr, Operand(0xfffffffffc001fffUL)), |
| 693 "mov x8, #0xfffffffffc001fff"); | 703 "mov x8, #0xfffffffffc001fff"); |
| 694 COMPARE(orr(x9, xzr, Operand(0xffffffffc001ffffUL)), | 704 COMPARE(orr(x9, xzr, Operand(0xffffffffc001ffffUL)), |
| 695 "orr x9, xzr, #0xffffffffc001ffff"); | 705 "orr x9, xzr, #0xffffffffc001ffff"); |
| 696 | 706 |
| 697 CLEANUP(); | 707 CLEANUP(); |
| 698 } | 708 } |
| 699 | 709 |
| 700 | 710 |
| 701 TEST_(logical_shifted) { | 711 TEST_(logical_shifted) { |
| 702 SET_UP(); | 712 SET_UP_ASM(); |
| 703 | 713 |
| 704 COMPARE(and_(w0, w1, Operand(w2)), "and w0, w1, w2"); | 714 COMPARE(and_(w0, w1, Operand(w2)), "and w0, w1, w2"); |
| 705 COMPARE(and_(x3, x4, Operand(x5, LSL, 1)), "and x3, x4, x5, lsl #1"); | 715 COMPARE(and_(x3, x4, Operand(x5, LSL, 1)), "and x3, x4, x5, lsl #1"); |
| 706 COMPARE(and_(w6, w7, Operand(w8, LSR, 2)), "and w6, w7, w8, lsr #2"); | 716 COMPARE(and_(w6, w7, Operand(w8, LSR, 2)), "and w6, w7, w8, lsr #2"); |
| 707 COMPARE(and_(x9, x10, Operand(x11, ASR, 3)), "and x9, x10, x11, asr #3"); | 717 COMPARE(and_(x9, x10, Operand(x11, ASR, 3)), "and x9, x10, x11, asr #3"); |
| 708 COMPARE(and_(w12, w13, Operand(w14, ROR, 4)), "and w12, w13, w14, ror #4"); | 718 COMPARE(and_(w12, w13, Operand(w14, ROR, 4)), "and w12, w13, w14, ror #4"); |
| 709 | 719 |
| 710 COMPARE(bic(w15, w16, Operand(w17)), "bic w15, w16, w17"); | 720 COMPARE(bic(w15, w16, Operand(w17)), "bic w15, w16, w17"); |
| 711 COMPARE(bic(x18, x19, Operand(x20, LSL, 5)), "bic x18, x19, x20, lsl #5"); | 721 COMPARE(bic(x18, x19, Operand(x20, LSL, 5)), "bic x18, x19, x20, lsl #5"); |
| 712 COMPARE(bic(w21, w22, Operand(w23, LSR, 6)), "bic w21, w22, w23, lsr #6"); | 722 COMPARE(bic(w21, w22, Operand(w23, LSR, 6)), "bic w21, w22, w23, lsr #6"); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 COMPARE(orr(w0, wzr, Operand(w1)), "mov w0, w1"); | 772 COMPARE(orr(w0, wzr, Operand(w1)), "mov w0, w1"); |
| 763 COMPARE(orr(x0, xzr, Operand(x1)), "mov x0, x1"); | 773 COMPARE(orr(x0, xzr, Operand(x1)), "mov x0, x1"); |
| 764 COMPARE(orr(w16, wzr, Operand(w17, LSL, 1)), "orr w16, wzr, w17, lsl #1"); | 774 COMPARE(orr(w16, wzr, Operand(w17, LSL, 1)), "orr w16, wzr, w17, lsl #1"); |
| 765 COMPARE(orr(x16, xzr, Operand(x17, ASR, 2)), "orr x16, xzr, x17, asr #2"); | 775 COMPARE(orr(x16, xzr, Operand(x17, ASR, 2)), "orr x16, xzr, x17, asr #2"); |
| 766 | 776 |
| 767 CLEANUP(); | 777 CLEANUP(); |
| 768 } | 778 } |
| 769 | 779 |
| 770 | 780 |
| 771 TEST_(dp_2_source) { | 781 TEST_(dp_2_source) { |
| 772 SET_UP(); | 782 SET_UP_ASM(); |
| 773 | 783 |
| 774 COMPARE(lslv(w0, w1, w2), "lsl w0, w1, w2"); | 784 COMPARE(lslv(w0, w1, w2), "lsl w0, w1, w2"); |
| 775 COMPARE(lslv(x3, x4, x5), "lsl x3, x4, x5"); | 785 COMPARE(lslv(x3, x4, x5), "lsl x3, x4, x5"); |
| 776 COMPARE(lsrv(w6, w7, w8), "lsr w6, w7, w8"); | 786 COMPARE(lsrv(w6, w7, w8), "lsr w6, w7, w8"); |
| 777 COMPARE(lsrv(x9, x10, x11), "lsr x9, x10, x11"); | 787 COMPARE(lsrv(x9, x10, x11), "lsr x9, x10, x11"); |
| 778 COMPARE(asrv(w12, w13, w14), "asr w12, w13, w14"); | 788 COMPARE(asrv(w12, w13, w14), "asr w12, w13, w14"); |
| 779 COMPARE(asrv(x15, x16, x17), "asr x15, x16, x17"); | 789 COMPARE(asrv(x15, x16, x17), "asr x15, x16, x17"); |
| 780 COMPARE(rorv(w18, w19, w20), "ror w18, w19, w20"); | 790 COMPARE(rorv(w18, w19, w20), "ror w18, w19, w20"); |
| 781 COMPARE(rorv(x21, x22, x23), "ror x21, x22, x23"); | 791 COMPARE(rorv(x21, x22, x23), "ror x21, x22, x23"); |
| 782 | 792 |
| 783 CLEANUP(); | 793 CLEANUP(); |
| 784 } | 794 } |
| 785 | 795 |
| 786 | 796 |
| 787 TEST_(adr) { | 797 TEST_(adr) { |
| 788 SET_UP(); | 798 SET_UP_ASM(); |
| 789 | 799 |
| 790 COMPARE_PREFIX(adr(x0, 0), "adr x0, #+0x0"); | 800 COMPARE_PREFIX(adr(x0, 0), "adr x0, #+0x0"); |
| 791 COMPARE_PREFIX(adr(x1, 1), "adr x1, #+0x1"); | 801 COMPARE_PREFIX(adr(x1, 1), "adr x1, #+0x1"); |
| 792 COMPARE_PREFIX(adr(x2, -1), "adr x2, #-0x1"); | 802 COMPARE_PREFIX(adr(x2, -1), "adr x2, #-0x1"); |
| 793 COMPARE_PREFIX(adr(x3, 4), "adr x3, #+0x4"); | 803 COMPARE_PREFIX(adr(x3, 4), "adr x3, #+0x4"); |
| 794 COMPARE_PREFIX(adr(x4, -4), "adr x4, #-0x4"); | 804 COMPARE_PREFIX(adr(x4, -4), "adr x4, #-0x4"); |
| 795 COMPARE_PREFIX(adr(x5, 0x000fffff), "adr x5, #+0xfffff"); | 805 COMPARE_PREFIX(adr(x5, 0x000fffff), "adr x5, #+0xfffff"); |
| 796 COMPARE_PREFIX(adr(x6, -0x00100000), "adr x6, #-0x100000"); | 806 COMPARE_PREFIX(adr(x6, -0x00100000), "adr x6, #-0x100000"); |
| 797 COMPARE_PREFIX(adr(xzr, 0), "adr xzr, #+0x0"); | 807 COMPARE_PREFIX(adr(xzr, 0), "adr xzr, #+0x0"); |
| 798 | 808 |
| 799 CLEANUP(); | 809 CLEANUP(); |
| 800 } | 810 } |
| 801 | 811 |
| 802 | 812 |
| 803 TEST_(branch) { | 813 TEST_(branch) { |
| 804 SET_UP(); | 814 SET_UP_ASM(); |
| 805 | 815 |
| 806 #define INST_OFF(x) ((x) >> kInstructionSizeLog2) | 816 #define INST_OFF(x) ((x) >> kInstructionSizeLog2) |
| 807 COMPARE_PREFIX(b(INST_OFF(0x4)), "b #+0x4"); | 817 COMPARE_PREFIX(b(INST_OFF(0x4)), "b #+0x4"); |
| 808 COMPARE_PREFIX(b(INST_OFF(-0x4)), "b #-0x4"); | 818 COMPARE_PREFIX(b(INST_OFF(-0x4)), "b #-0x4"); |
| 809 COMPARE_PREFIX(b(INST_OFF(0x7fffffc)), "b #+0x7fffffc"); | 819 COMPARE_PREFIX(b(INST_OFF(0x7fffffc)), "b #+0x7fffffc"); |
| 810 COMPARE_PREFIX(b(INST_OFF(-0x8000000)), "b #-0x8000000"); | 820 COMPARE_PREFIX(b(INST_OFF(-0x8000000)), "b #-0x8000000"); |
| 811 COMPARE_PREFIX(b(INST_OFF(0xffffc), eq), "b.eq #+0xffffc"); | 821 COMPARE_PREFIX(b(INST_OFF(0xffffc), eq), "b.eq #+0xffffc"); |
| 812 COMPARE_PREFIX(b(INST_OFF(-0x100000), mi), "b.mi #-0x100000"); | 822 COMPARE_PREFIX(b(INST_OFF(-0x100000), mi), "b.mi #-0x100000"); |
| 813 COMPARE_PREFIX(bl(INST_OFF(0x4)), "bl #+0x4"); | 823 COMPARE_PREFIX(bl(INST_OFF(0x4)), "bl #+0x4"); |
| 814 COMPARE_PREFIX(bl(INST_OFF(-0x4)), "bl #-0x4"); | 824 COMPARE_PREFIX(bl(INST_OFF(-0x4)), "bl #-0x4"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 831 COMPARE(br(x0), "br x0"); | 841 COMPARE(br(x0), "br x0"); |
| 832 COMPARE(blr(x1), "blr x1"); | 842 COMPARE(blr(x1), "blr x1"); |
| 833 COMPARE(ret(x2), "ret x2"); | 843 COMPARE(ret(x2), "ret x2"); |
| 834 COMPARE(ret(lr), "ret") | 844 COMPARE(ret(lr), "ret") |
| 835 | 845 |
| 836 CLEANUP(); | 846 CLEANUP(); |
| 837 } | 847 } |
| 838 | 848 |
| 839 | 849 |
| 840 TEST_(load_store) { | 850 TEST_(load_store) { |
| 841 SET_UP(); | 851 SET_UP_ASM(); |
| 842 | 852 |
| 843 COMPARE(ldr(w0, MemOperand(x1)), "ldr w0, [x1]"); | 853 COMPARE(ldr(w0, MemOperand(x1)), "ldr w0, [x1]"); |
| 844 COMPARE(ldr(w2, MemOperand(x3, 4)), "ldr w2, [x3, #4]"); | 854 COMPARE(ldr(w2, MemOperand(x3, 4)), "ldr w2, [x3, #4]"); |
| 845 COMPARE(ldr(w4, MemOperand(x5, 16380)), "ldr w4, [x5, #16380]"); | 855 COMPARE(ldr(w4, MemOperand(x5, 16380)), "ldr w4, [x5, #16380]"); |
| 846 COMPARE(ldr(x6, MemOperand(x7)), "ldr x6, [x7]"); | 856 COMPARE(ldr(x6, MemOperand(x7)), "ldr x6, [x7]"); |
| 847 COMPARE(ldr(x8, MemOperand(x9, 8)), "ldr x8, [x9, #8]"); | 857 COMPARE(ldr(x8, MemOperand(x9, 8)), "ldr x8, [x9, #8]"); |
| 848 COMPARE(ldr(x10, MemOperand(x11, 32760)), "ldr x10, [x11, #32760]"); | 858 COMPARE(ldr(x10, MemOperand(x11, 32760)), "ldr x10, [x11, #32760]"); |
| 849 COMPARE(str(w12, MemOperand(x13)), "str w12, [x13]"); | 859 COMPARE(str(w12, MemOperand(x13)), "str w12, [x13]"); |
| 850 COMPARE(str(w14, MemOperand(x15, 4)), "str w14, [x15, #4]"); | 860 COMPARE(str(w14, MemOperand(x15, 4)), "str w14, [x15, #4]"); |
| 851 COMPARE(str(w16, MemOperand(x17, 16380)), "str w16, [x17, #16380]"); | 861 COMPARE(str(w16, MemOperand(x17, 16380)), "str w16, [x17, #16380]"); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 COMPARE(ldrsw(x0, MemOperand(x1)), "ldrsw x0, [x1]"); | 898 COMPARE(ldrsw(x0, MemOperand(x1)), "ldrsw x0, [x1]"); |
| 889 COMPARE(ldrsw(x2, MemOperand(x3, 8)), "ldrsw x2, [x3, #8]"); | 899 COMPARE(ldrsw(x2, MemOperand(x3, 8)), "ldrsw x2, [x3, #8]"); |
| 890 COMPARE(ldrsw(x4, MemOperand(x5, 42, PreIndex)), "ldrsw x4, [x5, #42]!"); | 900 COMPARE(ldrsw(x4, MemOperand(x5, 42, PreIndex)), "ldrsw x4, [x5, #42]!"); |
| 891 COMPARE(ldrsw(x6, MemOperand(x7, -11, PostIndex)), "ldrsw x6, [x7], #-11"); | 901 COMPARE(ldrsw(x6, MemOperand(x7, -11, PostIndex)), "ldrsw x6, [x7], #-11"); |
| 892 | 902 |
| 893 CLEANUP(); | 903 CLEANUP(); |
| 894 } | 904 } |
| 895 | 905 |
| 896 | 906 |
| 897 TEST_(load_store_regoffset) { | 907 TEST_(load_store_regoffset) { |
| 898 SET_UP(); | 908 SET_UP_ASM(); |
| 899 | 909 |
| 900 COMPARE(ldr(w0, MemOperand(x1, w2, UXTW)), "ldr w0, [x1, w2, uxtw]"); | 910 COMPARE(ldr(w0, MemOperand(x1, w2, UXTW)), "ldr w0, [x1, w2, uxtw]"); |
| 901 COMPARE(ldr(w3, MemOperand(x4, w5, UXTW, 2)), "ldr w3, [x4, w5, uxtw #2]"); | 911 COMPARE(ldr(w3, MemOperand(x4, w5, UXTW, 2)), "ldr w3, [x4, w5, uxtw #2]"); |
| 902 COMPARE(ldr(w6, MemOperand(x7, x8)), "ldr w6, [x7, x8]"); | 912 COMPARE(ldr(w6, MemOperand(x7, x8)), "ldr w6, [x7, x8]"); |
| 903 COMPARE(ldr(w9, MemOperand(x10, x11, LSL, 2)), "ldr w9, [x10, x11, lsl #2]"); | 913 COMPARE(ldr(w9, MemOperand(x10, x11, LSL, 2)), "ldr w9, [x10, x11, lsl #2]"); |
| 904 COMPARE(ldr(w12, MemOperand(x13, w14, SXTW)), "ldr w12, [x13, w14, sxtw]"); | 914 COMPARE(ldr(w12, MemOperand(x13, w14, SXTW)), "ldr w12, [x13, w14, sxtw]"); |
| 905 COMPARE(ldr(w15, MemOperand(x16, w17, SXTW, 2)), | 915 COMPARE(ldr(w15, MemOperand(x16, w17, SXTW, 2)), |
| 906 "ldr w15, [x16, w17, sxtw #2]"); | 916 "ldr w15, [x16, w17, sxtw #2]"); |
| 907 COMPARE(ldr(w18, MemOperand(x19, x20, SXTX)), "ldr w18, [x19, x20, sxtx]"); | 917 COMPARE(ldr(w18, MemOperand(x19, x20, SXTX)), "ldr w18, [x19, x20, sxtx]"); |
| 908 COMPARE(ldr(w21, MemOperand(x22, x23, SXTX, 2)), | 918 COMPARE(ldr(w21, MemOperand(x22, x23, SXTX, 2)), |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 | 983 |
| 974 // TODO(all): Fix this for jssp. | 984 // TODO(all): Fix this for jssp. |
| 975 COMPARE(ldr(x0, MemOperand(jssp, wzr, SXTW)), "ldr x0, [jssp, wzr, sxtw]"); | 985 COMPARE(ldr(x0, MemOperand(jssp, wzr, SXTW)), "ldr x0, [jssp, wzr, sxtw]"); |
| 976 COMPARE(str(x1, MemOperand(jssp, xzr)), "str x1, [jssp, xzr]"); | 986 COMPARE(str(x1, MemOperand(jssp, xzr)), "str x1, [jssp, xzr]"); |
| 977 | 987 |
| 978 CLEANUP(); | 988 CLEANUP(); |
| 979 } | 989 } |
| 980 | 990 |
| 981 | 991 |
| 982 TEST_(load_store_byte) { | 992 TEST_(load_store_byte) { |
| 983 SET_UP(); | 993 SET_UP_ASM(); |
| 984 | 994 |
| 985 COMPARE(ldrb(w0, MemOperand(x1)), "ldrb w0, [x1]"); | 995 COMPARE(ldrb(w0, MemOperand(x1)), "ldrb w0, [x1]"); |
| 986 COMPARE(ldrb(x2, MemOperand(x3)), "ldrb w2, [x3]"); | 996 COMPARE(ldrb(x2, MemOperand(x3)), "ldrb w2, [x3]"); |
| 987 COMPARE(ldrb(w4, MemOperand(x5, 4095)), "ldrb w4, [x5, #4095]"); | 997 COMPARE(ldrb(w4, MemOperand(x5, 4095)), "ldrb w4, [x5, #4095]"); |
| 988 COMPARE(ldrb(w6, MemOperand(x7, 255, PreIndex)), "ldrb w6, [x7, #255]!"); | 998 COMPARE(ldrb(w6, MemOperand(x7, 255, PreIndex)), "ldrb w6, [x7, #255]!"); |
| 989 COMPARE(ldrb(w8, MemOperand(x9, -256, PreIndex)), "ldrb w8, [x9, #-256]!"); | 999 COMPARE(ldrb(w8, MemOperand(x9, -256, PreIndex)), "ldrb w8, [x9, #-256]!"); |
| 990 COMPARE(ldrb(w10, MemOperand(x11, 255, PostIndex)), "ldrb w10, [x11], #255"); | 1000 COMPARE(ldrb(w10, MemOperand(x11, 255, PostIndex)), "ldrb w10, [x11], #255"); |
| 991 COMPARE(ldrb(w12, MemOperand(x13, -256, PostIndex)), | 1001 COMPARE(ldrb(w12, MemOperand(x13, -256, PostIndex)), |
| 992 "ldrb w12, [x13], #-256"); | 1002 "ldrb w12, [x13], #-256"); |
| 993 COMPARE(strb(w14, MemOperand(x15)), "strb w14, [x15]"); | 1003 COMPARE(strb(w14, MemOperand(x15)), "strb w14, [x15]"); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1005 COMPARE(ldrsb(w0, MemOperand(x1)), "ldrsb w0, [x1]"); | 1015 COMPARE(ldrsb(w0, MemOperand(x1)), "ldrsb w0, [x1]"); |
| 1006 COMPARE(ldrsb(x2, MemOperand(x3, 8)), "ldrsb x2, [x3, #8]"); | 1016 COMPARE(ldrsb(x2, MemOperand(x3, 8)), "ldrsb x2, [x3, #8]"); |
| 1007 COMPARE(ldrsb(w4, MemOperand(x5, 42, PreIndex)), "ldrsb w4, [x5, #42]!"); | 1017 COMPARE(ldrsb(w4, MemOperand(x5, 42, PreIndex)), "ldrsb w4, [x5, #42]!"); |
| 1008 COMPARE(ldrsb(x6, MemOperand(x7, -11, PostIndex)), "ldrsb x6, [x7], #-11"); | 1018 COMPARE(ldrsb(x6, MemOperand(x7, -11, PostIndex)), "ldrsb x6, [x7], #-11"); |
| 1009 | 1019 |
| 1010 CLEANUP(); | 1020 CLEANUP(); |
| 1011 } | 1021 } |
| 1012 | 1022 |
| 1013 | 1023 |
| 1014 TEST_(load_store_half) { | 1024 TEST_(load_store_half) { |
| 1015 SET_UP(); | 1025 SET_UP_ASM(); |
| 1016 | 1026 |
| 1017 COMPARE(ldrh(w0, MemOperand(x1)), "ldrh w0, [x1]"); | 1027 COMPARE(ldrh(w0, MemOperand(x1)), "ldrh w0, [x1]"); |
| 1018 COMPARE(ldrh(x2, MemOperand(x3)), "ldrh w2, [x3]"); | 1028 COMPARE(ldrh(x2, MemOperand(x3)), "ldrh w2, [x3]"); |
| 1019 COMPARE(ldrh(w4, MemOperand(x5, 8190)), "ldrh w4, [x5, #8190]"); | 1029 COMPARE(ldrh(w4, MemOperand(x5, 8190)), "ldrh w4, [x5, #8190]"); |
| 1020 COMPARE(ldrh(w6, MemOperand(x7, 255, PreIndex)), "ldrh w6, [x7, #255]!"); | 1030 COMPARE(ldrh(w6, MemOperand(x7, 255, PreIndex)), "ldrh w6, [x7, #255]!"); |
| 1021 COMPARE(ldrh(w8, MemOperand(x9, -256, PreIndex)), "ldrh w8, [x9, #-256]!"); | 1031 COMPARE(ldrh(w8, MemOperand(x9, -256, PreIndex)), "ldrh w8, [x9, #-256]!"); |
| 1022 COMPARE(ldrh(w10, MemOperand(x11, 255, PostIndex)), "ldrh w10, [x11], #255"); | 1032 COMPARE(ldrh(w10, MemOperand(x11, 255, PostIndex)), "ldrh w10, [x11], #255"); |
| 1023 COMPARE(ldrh(w12, MemOperand(x13, -256, PostIndex)), | 1033 COMPARE(ldrh(w12, MemOperand(x13, -256, PostIndex)), |
| 1024 "ldrh w12, [x13], #-256"); | 1034 "ldrh w12, [x13], #-256"); |
| 1025 COMPARE(strh(w14, MemOperand(x15)), "strh w14, [x15]"); | 1035 COMPARE(strh(w14, MemOperand(x15)), "strh w14, [x15]"); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1041 COMPARE(ldrsh(w0, MemOperand(x1)), "ldrsh w0, [x1]"); | 1051 COMPARE(ldrsh(w0, MemOperand(x1)), "ldrsh w0, [x1]"); |
| 1042 COMPARE(ldrsh(w2, MemOperand(x3, 8)), "ldrsh w2, [x3, #8]"); | 1052 COMPARE(ldrsh(w2, MemOperand(x3, 8)), "ldrsh w2, [x3, #8]"); |
| 1043 COMPARE(ldrsh(w4, MemOperand(x5, 42, PreIndex)), "ldrsh w4, [x5, #42]!"); | 1053 COMPARE(ldrsh(w4, MemOperand(x5, 42, PreIndex)), "ldrsh w4, [x5, #42]!"); |
| 1044 COMPARE(ldrsh(x6, MemOperand(x7, -11, PostIndex)), "ldrsh x6, [x7], #-11"); | 1054 COMPARE(ldrsh(x6, MemOperand(x7, -11, PostIndex)), "ldrsh x6, [x7], #-11"); |
| 1045 | 1055 |
| 1046 CLEANUP(); | 1056 CLEANUP(); |
| 1047 } | 1057 } |
| 1048 | 1058 |
| 1049 | 1059 |
| 1050 TEST_(load_store_fp) { | 1060 TEST_(load_store_fp) { |
| 1051 SET_UP(); | 1061 SET_UP_ASM(); |
| 1052 | 1062 |
| 1053 COMPARE(ldr(s0, MemOperand(x1)), "ldr s0, [x1]"); | 1063 COMPARE(ldr(s0, MemOperand(x1)), "ldr s0, [x1]"); |
| 1054 COMPARE(ldr(s2, MemOperand(x3, 4)), "ldr s2, [x3, #4]"); | 1064 COMPARE(ldr(s2, MemOperand(x3, 4)), "ldr s2, [x3, #4]"); |
| 1055 COMPARE(ldr(s4, MemOperand(x5, 16380)), "ldr s4, [x5, #16380]"); | 1065 COMPARE(ldr(s4, MemOperand(x5, 16380)), "ldr s4, [x5, #16380]"); |
| 1056 COMPARE(ldr(d6, MemOperand(x7)), "ldr d6, [x7]"); | 1066 COMPARE(ldr(d6, MemOperand(x7)), "ldr d6, [x7]"); |
| 1057 COMPARE(ldr(d8, MemOperand(x9, 8)), "ldr d8, [x9, #8]"); | 1067 COMPARE(ldr(d8, MemOperand(x9, 8)), "ldr d8, [x9, #8]"); |
| 1058 COMPARE(ldr(d10, MemOperand(x11, 32760)), "ldr d10, [x11, #32760]"); | 1068 COMPARE(ldr(d10, MemOperand(x11, 32760)), "ldr d10, [x11, #32760]"); |
| 1059 COMPARE(str(s12, MemOperand(x13)), "str s12, [x13]"); | 1069 COMPARE(str(s12, MemOperand(x13)), "str s12, [x13]"); |
| 1060 COMPARE(str(s14, MemOperand(x15, 4)), "str s14, [x15, #4]"); | 1070 COMPARE(str(s14, MemOperand(x15, 4)), "str s14, [x15, #4]"); |
| 1061 COMPARE(str(s16, MemOperand(x17, 16380)), "str s16, [x17, #16380]"); | 1071 COMPARE(str(s16, MemOperand(x17, 16380)), "str s16, [x17, #16380]"); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 COMPARE(ldr(s24, MemOperand(jssp)), "ldr s24, [jssp]"); | 1103 COMPARE(ldr(s24, MemOperand(jssp)), "ldr s24, [jssp]"); |
| 1094 COMPARE(ldr(d25, MemOperand(jssp, 8)), "ldr d25, [jssp, #8]"); | 1104 COMPARE(ldr(d25, MemOperand(jssp, 8)), "ldr d25, [jssp, #8]"); |
| 1095 COMPARE(str(s26, MemOperand(jssp, 4, PreIndex)), "str s26, [jssp, #4]!"); | 1105 COMPARE(str(s26, MemOperand(jssp, 4, PreIndex)), "str s26, [jssp, #4]!"); |
| 1096 COMPARE(str(d27, MemOperand(jssp, -8, PostIndex)), "str d27, [jssp], #-8"); | 1106 COMPARE(str(d27, MemOperand(jssp, -8, PostIndex)), "str d27, [jssp], #-8"); |
| 1097 | 1107 |
| 1098 CLEANUP(); | 1108 CLEANUP(); |
| 1099 } | 1109 } |
| 1100 | 1110 |
| 1101 | 1111 |
| 1102 TEST_(load_store_unscaled) { | 1112 TEST_(load_store_unscaled) { |
| 1103 SET_UP(); | 1113 SET_UP_ASM(); |
| 1104 | 1114 |
| 1105 COMPARE(ldr(w0, MemOperand(x1, 1)), "ldur w0, [x1, #1]"); | 1115 COMPARE(ldr(w0, MemOperand(x1, 1)), "ldur w0, [x1, #1]"); |
| 1106 COMPARE(ldr(w2, MemOperand(x3, -1)), "ldur w2, [x3, #-1]"); | 1116 COMPARE(ldr(w2, MemOperand(x3, -1)), "ldur w2, [x3, #-1]"); |
| 1107 COMPARE(ldr(w4, MemOperand(x5, 255)), "ldur w4, [x5, #255]"); | 1117 COMPARE(ldr(w4, MemOperand(x5, 255)), "ldur w4, [x5, #255]"); |
| 1108 COMPARE(ldr(w6, MemOperand(x7, -256)), "ldur w6, [x7, #-256]"); | 1118 COMPARE(ldr(w6, MemOperand(x7, -256)), "ldur w6, [x7, #-256]"); |
| 1109 COMPARE(ldr(x8, MemOperand(x9, 1)), "ldur x8, [x9, #1]"); | 1119 COMPARE(ldr(x8, MemOperand(x9, 1)), "ldur x8, [x9, #1]"); |
| 1110 COMPARE(ldr(x10, MemOperand(x11, -1)), "ldur x10, [x11, #-1]"); | 1120 COMPARE(ldr(x10, MemOperand(x11, -1)), "ldur x10, [x11, #-1]"); |
| 1111 COMPARE(ldr(x12, MemOperand(x13, 255)), "ldur x12, [x13, #255]"); | 1121 COMPARE(ldr(x12, MemOperand(x13, 255)), "ldur x12, [x13, #255]"); |
| 1112 COMPARE(ldr(x14, MemOperand(x15, -256)), "ldur x14, [x15, #-256]"); | 1122 COMPARE(ldr(x14, MemOperand(x15, -256)), "ldur x14, [x15, #-256]"); |
| 1113 COMPARE(str(w16, MemOperand(x17, 1)), "stur w16, [x17, #1]"); | 1123 COMPARE(str(w16, MemOperand(x17, 1)), "stur w16, [x17, #1]"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1126 COMPARE(ldrh(w8, MemOperand(x9, -5)), "ldurh w8, [x9, #-5]"); | 1136 COMPARE(ldrh(w8, MemOperand(x9, -5)), "ldurh w8, [x9, #-5]"); |
| 1127 COMPARE(ldrsh(w10, MemOperand(x11, -6)), "ldursh w10, [x11, #-6]"); | 1137 COMPARE(ldrsh(w10, MemOperand(x11, -6)), "ldursh w10, [x11, #-6]"); |
| 1128 COMPARE(ldrsh(x12, MemOperand(x13, -7)), "ldursh x12, [x13, #-7]"); | 1138 COMPARE(ldrsh(x12, MemOperand(x13, -7)), "ldursh x12, [x13, #-7]"); |
| 1129 COMPARE(ldrsw(x14, MemOperand(x15, -8)), "ldursw x14, [x15, #-8]"); | 1139 COMPARE(ldrsw(x14, MemOperand(x15, -8)), "ldursw x14, [x15, #-8]"); |
| 1130 | 1140 |
| 1131 CLEANUP(); | 1141 CLEANUP(); |
| 1132 } | 1142 } |
| 1133 | 1143 |
| 1134 | 1144 |
| 1135 TEST_(load_store_pair) { | 1145 TEST_(load_store_pair) { |
| 1136 SET_UP(); | 1146 SET_UP_ASM(); |
| 1137 | 1147 |
| 1138 COMPARE(ldp(w0, w1, MemOperand(x2)), "ldp w0, w1, [x2]"); | 1148 COMPARE(ldp(w0, w1, MemOperand(x2)), "ldp w0, w1, [x2]"); |
| 1139 COMPARE(ldp(x3, x4, MemOperand(x5)), "ldp x3, x4, [x5]"); | 1149 COMPARE(ldp(x3, x4, MemOperand(x5)), "ldp x3, x4, [x5]"); |
| 1140 COMPARE(ldp(w6, w7, MemOperand(x8, 4)), "ldp w6, w7, [x8, #4]"); | 1150 COMPARE(ldp(w6, w7, MemOperand(x8, 4)), "ldp w6, w7, [x8, #4]"); |
| 1141 COMPARE(ldp(x9, x10, MemOperand(x11, 8)), "ldp x9, x10, [x11, #8]"); | 1151 COMPARE(ldp(x9, x10, MemOperand(x11, 8)), "ldp x9, x10, [x11, #8]"); |
| 1142 COMPARE(ldp(w12, w13, MemOperand(x14, 252)), "ldp w12, w13, [x14, #252]"); | 1152 COMPARE(ldp(w12, w13, MemOperand(x14, 252)), "ldp w12, w13, [x14, #252]"); |
| 1143 COMPARE(ldp(x15, x16, MemOperand(x17, 504)), "ldp x15, x16, [x17, #504]"); | 1153 COMPARE(ldp(x15, x16, MemOperand(x17, 504)), "ldp x15, x16, [x17, #504]"); |
| 1144 COMPARE(ldp(w18, w19, MemOperand(x20, -256)), "ldp w18, w19, [x20, #-256]"); | 1154 COMPARE(ldp(w18, w19, MemOperand(x20, -256)), "ldp w18, w19, [x20, #-256]"); |
| 1145 COMPARE(ldp(x21, x22, MemOperand(x23, -512)), "ldp x21, x22, [x23, #-512]"); | 1155 COMPARE(ldp(x21, x22, MemOperand(x23, -512)), "ldp x21, x22, [x23, #-512]"); |
| 1146 COMPARE(ldp(w24, w25, MemOperand(x26, 252, PreIndex)), | 1156 COMPARE(ldp(w24, w25, MemOperand(x26, 252, PreIndex)), |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 "ldpsw x6, x7, [x8, #-32]!"); | 1257 "ldpsw x6, x7, [x8, #-32]!"); |
| 1248 COMPARE(ldpsw(x9, x10, MemOperand(x11, 128, PostIndex)), | 1258 COMPARE(ldpsw(x9, x10, MemOperand(x11, 128, PostIndex)), |
| 1249 "ldpsw x9, x10, [x11], #128"); | 1259 "ldpsw x9, x10, [x11], #128"); |
| 1250 | 1260 |
| 1251 CLEANUP(); | 1261 CLEANUP(); |
| 1252 } | 1262 } |
| 1253 | 1263 |
| 1254 | 1264 |
| 1255 #if 0 // TODO(all): enable. | 1265 #if 0 // TODO(all): enable. |
| 1256 TEST_(load_literal) { | 1266 TEST_(load_literal) { |
| 1257 SET_UP(); | 1267 SET_UP_ASM(); |
| 1258 | 1268 |
| 1259 COMPARE_PREFIX(ldr(x10, 0x1234567890abcdefUL), "ldr x10, pc+8"); | 1269 COMPARE_PREFIX(ldr(x10, 0x1234567890abcdefUL), "ldr x10, pc+8"); |
| 1260 COMPARE_PREFIX(ldr(w20, 0xfedcba09), "ldr w20, pc+8"); | 1270 COMPARE_PREFIX(ldr(w20, 0xfedcba09), "ldr w20, pc+8"); |
| 1261 COMPARE_PREFIX(ldr(d11, 1.234), "ldr d11, pc+8"); | 1271 COMPARE_PREFIX(ldr(d11, 1.234), "ldr d11, pc+8"); |
| 1262 COMPARE_PREFIX(ldr(s22, 2.5f), "ldr s22, pc+8"); | 1272 COMPARE_PREFIX(ldr(s22, 2.5f), "ldr s22, pc+8"); |
| 1263 | 1273 |
| 1264 CLEANUP(); | 1274 CLEANUP(); |
| 1265 } | 1275 } |
| 1266 #endif | 1276 #endif |
| 1267 | 1277 |
| 1268 TEST_(cond_select) { | 1278 TEST_(cond_select) { |
| 1269 SET_UP(); | 1279 SET_UP_ASM(); |
| 1270 | 1280 |
| 1271 COMPARE(csel(w0, w1, w2, eq), "csel w0, w1, w2, eq"); | 1281 COMPARE(csel(w0, w1, w2, eq), "csel w0, w1, w2, eq"); |
| 1272 COMPARE(csel(x3, x4, x5, ne), "csel x3, x4, x5, ne"); | 1282 COMPARE(csel(x3, x4, x5, ne), "csel x3, x4, x5, ne"); |
| 1273 COMPARE(csinc(w6, w7, w8, hs), "csinc w6, w7, w8, hs"); | 1283 COMPARE(csinc(w6, w7, w8, hs), "csinc w6, w7, w8, hs"); |
| 1274 COMPARE(csinc(x9, x10, x11, lo), "csinc x9, x10, x11, lo"); | 1284 COMPARE(csinc(x9, x10, x11, lo), "csinc x9, x10, x11, lo"); |
| 1275 COMPARE(csinv(w12, w13, w14, mi), "csinv w12, w13, w14, mi"); | 1285 COMPARE(csinv(w12, w13, w14, mi), "csinv w12, w13, w14, mi"); |
| 1276 COMPARE(csinv(x15, x16, x17, pl), "csinv x15, x16, x17, pl"); | 1286 COMPARE(csinv(x15, x16, x17, pl), "csinv x15, x16, x17, pl"); |
| 1277 COMPARE(csneg(w18, w19, w20, vs), "csneg w18, w19, w20, vs"); | 1287 COMPARE(csneg(w18, w19, w20, vs), "csneg w18, w19, w20, vs"); |
| 1278 COMPARE(csneg(x21, x22, x23, vc), "csneg x21, x22, x23, vc"); | 1288 COMPARE(csneg(x21, x22, x23, vc), "csneg x21, x22, x23, vc"); |
| 1279 COMPARE(cset(w24, hi), "cset w24, hi"); | 1289 COMPARE(cset(w24, hi), "cset w24, hi"); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1294 COMPARE(csinv(x4, x5, x6, al), "csinv x4, x5, x6, al"); | 1304 COMPARE(csinv(x4, x5, x6, al), "csinv x4, x5, x6, al"); |
| 1295 COMPARE(csinv(x5, x6, x7, nv), "csinv x5, x6, x7, nv"); | 1305 COMPARE(csinv(x5, x6, x7, nv), "csinv x5, x6, x7, nv"); |
| 1296 COMPARE(csneg(x6, x7, x8, al), "csneg x6, x7, x8, al"); | 1306 COMPARE(csneg(x6, x7, x8, al), "csneg x6, x7, x8, al"); |
| 1297 COMPARE(csneg(x7, x8, x9, nv), "csneg x7, x8, x9, nv"); | 1307 COMPARE(csneg(x7, x8, x9, nv), "csneg x7, x8, x9, nv"); |
| 1298 | 1308 |
| 1299 CLEANUP(); | 1309 CLEANUP(); |
| 1300 } | 1310 } |
| 1301 | 1311 |
| 1302 | 1312 |
| 1303 TEST(cond_select_macro) { | 1313 TEST(cond_select_macro) { |
| 1304 SET_UP_CLASS(MacroAssembler); | 1314 SET_UP_MASM(); |
| 1305 | 1315 |
| 1306 COMPARE(Csel(w0, w1, -1, eq), "csinv w0, w1, wzr, eq"); | 1316 COMPARE(Csel(w0, w1, -1, eq), "csinv w0, w1, wzr, eq"); |
| 1307 COMPARE(Csel(w2, w3, 0, ne), "csel w2, w3, wzr, ne"); | 1317 COMPARE(Csel(w2, w3, 0, ne), "csel w2, w3, wzr, ne"); |
| 1308 COMPARE(Csel(w4, w5, 1, hs), "csinc w4, w5, wzr, hs"); | 1318 COMPARE(Csel(w4, w5, 1, hs), "csinc w4, w5, wzr, hs"); |
| 1309 COMPARE(Csel(x6, x7, -1, lo), "csinv x6, x7, xzr, lo"); | 1319 COMPARE(Csel(x6, x7, -1, lo), "csinv x6, x7, xzr, lo"); |
| 1310 COMPARE(Csel(x8, x9, 0, mi), "csel x8, x9, xzr, mi"); | 1320 COMPARE(Csel(x8, x9, 0, mi), "csel x8, x9, xzr, mi"); |
| 1311 COMPARE(Csel(x10, x11, 1, pl), "csinc x10, x11, xzr, pl"); | 1321 COMPARE(Csel(x10, x11, 1, pl), "csinc x10, x11, xzr, pl"); |
| 1312 | 1322 |
| 1313 CLEANUP(); | 1323 CLEANUP(); |
| 1314 } | 1324 } |
| 1315 | 1325 |
| 1316 | 1326 |
| 1317 TEST_(cond_cmp) { | 1327 TEST_(cond_cmp) { |
| 1318 SET_UP(); | 1328 SET_UP_ASM(); |
| 1319 | 1329 |
| 1320 COMPARE(ccmn(w0, w1, NZCVFlag, eq), "ccmn w0, w1, #NZCV, eq"); | 1330 COMPARE(ccmn(w0, w1, NZCVFlag, eq), "ccmn w0, w1, #NZCV, eq"); |
| 1321 COMPARE(ccmn(x2, x3, NZCFlag, ne), "ccmn x2, x3, #NZCv, ne"); | 1331 COMPARE(ccmn(x2, x3, NZCFlag, ne), "ccmn x2, x3, #NZCv, ne"); |
| 1322 COMPARE(ccmp(w4, w5, NZVFlag, hs), "ccmp w4, w5, #NZcV, hs"); | 1332 COMPARE(ccmp(w4, w5, NZVFlag, hs), "ccmp w4, w5, #NZcV, hs"); |
| 1323 COMPARE(ccmp(x6, x7, NZFlag, lo), "ccmp x6, x7, #NZcv, lo"); | 1333 COMPARE(ccmp(x6, x7, NZFlag, lo), "ccmp x6, x7, #NZcv, lo"); |
| 1324 COMPARE(ccmn(w8, 31, NFlag, mi), "ccmn w8, #31, #Nzcv, mi"); | 1334 COMPARE(ccmn(w8, 31, NFlag, mi), "ccmn w8, #31, #Nzcv, mi"); |
| 1325 COMPARE(ccmn(x9, 30, NCFlag, pl), "ccmn x9, #30, #NzCv, pl"); | 1335 COMPARE(ccmn(x9, 30, NCFlag, pl), "ccmn x9, #30, #NzCv, pl"); |
| 1326 COMPARE(ccmp(w10, 29, NVFlag, vs), "ccmp w10, #29, #NzcV, vs"); | 1336 COMPARE(ccmp(w10, 29, NVFlag, vs), "ccmp w10, #29, #NzcV, vs"); |
| 1327 COMPARE(ccmp(x11, 28, NFlag, vc), "ccmp x11, #28, #Nzcv, vc"); | 1337 COMPARE(ccmp(x11, 28, NFlag, vc), "ccmp x11, #28, #Nzcv, vc"); |
| 1328 COMPARE(ccmn(w12, w13, NoFlag, al), "ccmn w12, w13, #nzcv, al"); | 1338 COMPARE(ccmn(w12, w13, NoFlag, al), "ccmn w12, w13, #nzcv, al"); |
| 1329 COMPARE(ccmp(x14, 27, ZVFlag, nv), "ccmp x14, #27, #nZcV, nv"); | 1339 COMPARE(ccmp(x14, 27, ZVFlag, nv), "ccmp x14, #27, #nZcV, nv"); |
| 1330 | 1340 |
| 1331 CLEANUP(); | 1341 CLEANUP(); |
| 1332 } | 1342 } |
| 1333 | 1343 |
| 1334 | 1344 |
| 1335 TEST_(cond_cmp_macro) { | 1345 TEST_(cond_cmp_macro) { |
| 1336 SET_UP_CLASS(MacroAssembler); | 1346 SET_UP_MASM(); |
| 1337 | 1347 |
| 1338 COMPARE(Ccmp(w0, -1, VFlag, hi), "ccmn w0, #1, #nzcV, hi"); | 1348 COMPARE(Ccmp(w0, -1, VFlag, hi), "ccmn w0, #1, #nzcV, hi"); |
| 1339 COMPARE(Ccmp(x1, -31, CFlag, ge), "ccmn x1, #31, #nzCv, ge"); | 1349 COMPARE(Ccmp(x1, -31, CFlag, ge), "ccmn x1, #31, #nzCv, ge"); |
| 1340 COMPARE(Ccmn(w2, -1, CVFlag, gt), "ccmp w2, #1, #nzCV, gt"); | 1350 COMPARE(Ccmn(w2, -1, CVFlag, gt), "ccmp w2, #1, #nzCV, gt"); |
| 1341 COMPARE(Ccmn(x3, -31, ZCVFlag, ls), "ccmp x3, #31, #nZCV, ls"); | 1351 COMPARE(Ccmn(x3, -31, ZCVFlag, ls), "ccmp x3, #31, #nZCV, ls"); |
| 1342 | 1352 |
| 1343 CLEANUP(); | 1353 CLEANUP(); |
| 1344 } | 1354 } |
| 1345 | 1355 |
| 1346 | 1356 |
| 1347 TEST_(fmov_imm) { | 1357 TEST_(fmov_imm) { |
| 1348 SET_UP(); | 1358 SET_UP_ASM(); |
| 1349 | 1359 |
| 1350 COMPARE(fmov(s0, 1.0f), "fmov s0, #0x70 (1.0000)"); | 1360 COMPARE(fmov(s0, 1.0f), "fmov s0, #0x70 (1.0000)"); |
| 1351 COMPARE(fmov(s31, -13.0f), "fmov s31, #0xaa (-13.0000)"); | 1361 COMPARE(fmov(s31, -13.0f), "fmov s31, #0xaa (-13.0000)"); |
| 1352 COMPARE(fmov(d1, 1.0), "fmov d1, #0x70 (1.0000)"); | 1362 COMPARE(fmov(d1, 1.0), "fmov d1, #0x70 (1.0000)"); |
| 1353 COMPARE(fmov(d29, -13.0), "fmov d29, #0xaa (-13.0000)"); | 1363 COMPARE(fmov(d29, -13.0), "fmov d29, #0xaa (-13.0000)"); |
| 1354 | 1364 |
| 1355 CLEANUP(); | 1365 CLEANUP(); |
| 1356 } | 1366 } |
| 1357 | 1367 |
| 1358 | 1368 |
| 1359 TEST_(fmov_reg) { | 1369 TEST_(fmov_reg) { |
| 1360 SET_UP(); | 1370 SET_UP_ASM(); |
| 1361 | 1371 |
| 1362 COMPARE(fmov(w3, s13), "fmov w3, s13"); | 1372 COMPARE(fmov(w3, s13), "fmov w3, s13"); |
| 1363 COMPARE(fmov(x6, d26), "fmov x6, d26"); | 1373 COMPARE(fmov(x6, d26), "fmov x6, d26"); |
| 1364 COMPARE(fmov(s11, w30), "fmov s11, w30"); | 1374 COMPARE(fmov(s11, w30), "fmov s11, w30"); |
| 1365 COMPARE(fmov(d31, x2), "fmov d31, x2"); | 1375 COMPARE(fmov(d31, x2), "fmov d31, x2"); |
| 1366 COMPARE(fmov(s12, s13), "fmov s12, s13"); | 1376 COMPARE(fmov(s12, s13), "fmov s12, s13"); |
| 1367 COMPARE(fmov(d22, d23), "fmov d22, d23"); | 1377 COMPARE(fmov(d22, d23), "fmov d22, d23"); |
| 1368 | 1378 |
| 1369 CLEANUP(); | 1379 CLEANUP(); |
| 1370 } | 1380 } |
| 1371 | 1381 |
| 1372 | 1382 |
| 1373 TEST_(fp_dp1) { | 1383 TEST_(fp_dp1) { |
| 1374 SET_UP(); | 1384 SET_UP_ASM(); |
| 1375 | 1385 |
| 1376 COMPARE(fabs(s0, s1), "fabs s0, s1"); | 1386 COMPARE(fabs(s0, s1), "fabs s0, s1"); |
| 1377 COMPARE(fabs(s31, s30), "fabs s31, s30"); | 1387 COMPARE(fabs(s31, s30), "fabs s31, s30"); |
| 1378 COMPARE(fabs(d2, d3), "fabs d2, d3"); | 1388 COMPARE(fabs(d2, d3), "fabs d2, d3"); |
| 1379 COMPARE(fabs(d31, d30), "fabs d31, d30"); | 1389 COMPARE(fabs(d31, d30), "fabs d31, d30"); |
| 1380 COMPARE(fneg(s4, s5), "fneg s4, s5"); | 1390 COMPARE(fneg(s4, s5), "fneg s4, s5"); |
| 1381 COMPARE(fneg(s31, s30), "fneg s31, s30"); | 1391 COMPARE(fneg(s31, s30), "fneg s31, s30"); |
| 1382 COMPARE(fneg(d6, d7), "fneg d6, d7"); | 1392 COMPARE(fneg(d6, d7), "fneg d6, d7"); |
| 1383 COMPARE(fneg(d31, d30), "fneg d31, d30"); | 1393 COMPARE(fneg(d31, d30), "fneg d31, d30"); |
| 1384 COMPARE(fsqrt(s8, s9), "fsqrt s8, s9"); | 1394 COMPARE(fsqrt(s8, s9), "fsqrt s8, s9"); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1402 COMPARE(frintz(d12, d13), "frintz d12, d13"); | 1412 COMPARE(frintz(d12, d13), "frintz d12, d13"); |
| 1403 COMPARE(frintz(d31, d30), "frintz d31, d30"); | 1413 COMPARE(frintz(d31, d30), "frintz d31, d30"); |
| 1404 COMPARE(fcvt(d14, s15), "fcvt d14, s15"); | 1414 COMPARE(fcvt(d14, s15), "fcvt d14, s15"); |
| 1405 COMPARE(fcvt(d31, s31), "fcvt d31, s31"); | 1415 COMPARE(fcvt(d31, s31), "fcvt d31, s31"); |
| 1406 | 1416 |
| 1407 CLEANUP(); | 1417 CLEANUP(); |
| 1408 } | 1418 } |
| 1409 | 1419 |
| 1410 | 1420 |
| 1411 TEST_(fp_dp2) { | 1421 TEST_(fp_dp2) { |
| 1412 SET_UP(); | 1422 SET_UP_ASM(); |
| 1413 | 1423 |
| 1414 COMPARE(fadd(s0, s1, s2), "fadd s0, s1, s2"); | 1424 COMPARE(fadd(s0, s1, s2), "fadd s0, s1, s2"); |
| 1415 COMPARE(fadd(d3, d4, d5), "fadd d3, d4, d5"); | 1425 COMPARE(fadd(d3, d4, d5), "fadd d3, d4, d5"); |
| 1416 COMPARE(fsub(s31, s30, s29), "fsub s31, s30, s29"); | 1426 COMPARE(fsub(s31, s30, s29), "fsub s31, s30, s29"); |
| 1417 COMPARE(fsub(d31, d30, d29), "fsub d31, d30, d29"); | 1427 COMPARE(fsub(d31, d30, d29), "fsub d31, d30, d29"); |
| 1418 COMPARE(fmul(s7, s8, s9), "fmul s7, s8, s9"); | 1428 COMPARE(fmul(s7, s8, s9), "fmul s7, s8, s9"); |
| 1419 COMPARE(fmul(d10, d11, d12), "fmul d10, d11, d12"); | 1429 COMPARE(fmul(d10, d11, d12), "fmul d10, d11, d12"); |
| 1420 COMPARE(fdiv(s13, s14, s15), "fdiv s13, s14, s15"); | 1430 COMPARE(fdiv(s13, s14, s15), "fdiv s13, s14, s15"); |
| 1421 COMPARE(fdiv(d16, d17, d18), "fdiv d16, d17, d18"); | 1431 COMPARE(fdiv(d16, d17, d18), "fdiv d16, d17, d18"); |
| 1422 COMPARE(fmax(s19, s20, s21), "fmax s19, s20, s21"); | 1432 COMPARE(fmax(s19, s20, s21), "fmax s19, s20, s21"); |
| 1423 COMPARE(fmax(d22, d23, d24), "fmax d22, d23, d24"); | 1433 COMPARE(fmax(d22, d23, d24), "fmax d22, d23, d24"); |
| 1424 COMPARE(fmin(s25, s26, s27), "fmin s25, s26, s27"); | 1434 COMPARE(fmin(s25, s26, s27), "fmin s25, s26, s27"); |
| 1425 COMPARE(fmin(d28, d29, d30), "fmin d28, d29, d30"); | 1435 COMPARE(fmin(d28, d29, d30), "fmin d28, d29, d30"); |
| 1426 COMPARE(fmaxnm(s31, s0, s1), "fmaxnm s31, s0, s1"); | 1436 COMPARE(fmaxnm(s31, s0, s1), "fmaxnm s31, s0, s1"); |
| 1427 COMPARE(fmaxnm(d2, d3, d4), "fmaxnm d2, d3, d4"); | 1437 COMPARE(fmaxnm(d2, d3, d4), "fmaxnm d2, d3, d4"); |
| 1428 COMPARE(fminnm(s5, s6, s7), "fminnm s5, s6, s7"); | 1438 COMPARE(fminnm(s5, s6, s7), "fminnm s5, s6, s7"); |
| 1429 COMPARE(fminnm(d8, d9, d10), "fminnm d8, d9, d10"); | 1439 COMPARE(fminnm(d8, d9, d10), "fminnm d8, d9, d10"); |
| 1430 | 1440 |
| 1431 CLEANUP(); | 1441 CLEANUP(); |
| 1432 } | 1442 } |
| 1433 | 1443 |
| 1434 | 1444 |
| 1435 TEST(fp_dp3) { | 1445 TEST(fp_dp3) { |
| 1436 SET_UP(); | 1446 SET_UP_ASM(); |
| 1437 | 1447 |
| 1438 COMPARE(fmadd(s7, s8, s9, s10), "fmadd s7, s8, s9, s10"); | 1448 COMPARE(fmadd(s7, s8, s9, s10), "fmadd s7, s8, s9, s10"); |
| 1439 COMPARE(fmadd(d10, d11, d12, d10), "fmadd d10, d11, d12, d10"); | 1449 COMPARE(fmadd(d10, d11, d12, d10), "fmadd d10, d11, d12, d10"); |
| 1440 COMPARE(fmsub(s7, s8, s9, s10), "fmsub s7, s8, s9, s10"); | 1450 COMPARE(fmsub(s7, s8, s9, s10), "fmsub s7, s8, s9, s10"); |
| 1441 COMPARE(fmsub(d10, d11, d12, d10), "fmsub d10, d11, d12, d10"); | 1451 COMPARE(fmsub(d10, d11, d12, d10), "fmsub d10, d11, d12, d10"); |
| 1442 | 1452 |
| 1443 COMPARE(fnmadd(s7, s8, s9, s10), "fnmadd s7, s8, s9, s10"); | 1453 COMPARE(fnmadd(s7, s8, s9, s10), "fnmadd s7, s8, s9, s10"); |
| 1444 COMPARE(fnmadd(d10, d11, d12, d10), "fnmadd d10, d11, d12, d10"); | 1454 COMPARE(fnmadd(d10, d11, d12, d10), "fnmadd d10, d11, d12, d10"); |
| 1445 COMPARE(fnmsub(s7, s8, s9, s10), "fnmsub s7, s8, s9, s10"); | 1455 COMPARE(fnmsub(s7, s8, s9, s10), "fnmsub s7, s8, s9, s10"); |
| 1446 COMPARE(fnmsub(d10, d11, d12, d10), "fnmsub d10, d11, d12, d10"); | 1456 COMPARE(fnmsub(d10, d11, d12, d10), "fnmsub d10, d11, d12, d10"); |
| 1447 | 1457 |
| 1448 CLEANUP(); | 1458 CLEANUP(); |
| 1449 } | 1459 } |
| 1450 | 1460 |
| 1451 | 1461 |
| 1452 TEST_(fp_compare) { | 1462 TEST_(fp_compare) { |
| 1453 SET_UP(); | 1463 SET_UP_ASM(); |
| 1454 | 1464 |
| 1455 COMPARE(fcmp(s0, s1), "fcmp s0, s1"); | 1465 COMPARE(fcmp(s0, s1), "fcmp s0, s1"); |
| 1456 COMPARE(fcmp(s31, s30), "fcmp s31, s30"); | 1466 COMPARE(fcmp(s31, s30), "fcmp s31, s30"); |
| 1457 COMPARE(fcmp(d0, d1), "fcmp d0, d1"); | 1467 COMPARE(fcmp(d0, d1), "fcmp d0, d1"); |
| 1458 COMPARE(fcmp(d31, d30), "fcmp d31, d30"); | 1468 COMPARE(fcmp(d31, d30), "fcmp d31, d30"); |
| 1459 COMPARE(fcmp(s12, 0), "fcmp s12, #0.0"); | 1469 COMPARE(fcmp(s12, 0), "fcmp s12, #0.0"); |
| 1460 COMPARE(fcmp(d12, 0), "fcmp d12, #0.0"); | 1470 COMPARE(fcmp(d12, 0), "fcmp d12, #0.0"); |
| 1461 | 1471 |
| 1462 CLEANUP(); | 1472 CLEANUP(); |
| 1463 } | 1473 } |
| 1464 | 1474 |
| 1465 | 1475 |
| 1466 TEST_(fp_cond_compare) { | 1476 TEST_(fp_cond_compare) { |
| 1467 SET_UP(); | 1477 SET_UP_ASM(); |
| 1468 | 1478 |
| 1469 COMPARE(fccmp(s0, s1, NoFlag, eq), "fccmp s0, s1, #nzcv, eq"); | 1479 COMPARE(fccmp(s0, s1, NoFlag, eq), "fccmp s0, s1, #nzcv, eq"); |
| 1470 COMPARE(fccmp(s2, s3, ZVFlag, ne), "fccmp s2, s3, #nZcV, ne"); | 1480 COMPARE(fccmp(s2, s3, ZVFlag, ne), "fccmp s2, s3, #nZcV, ne"); |
| 1471 COMPARE(fccmp(s30, s16, NCFlag, pl), "fccmp s30, s16, #NzCv, pl"); | 1481 COMPARE(fccmp(s30, s16, NCFlag, pl), "fccmp s30, s16, #NzCv, pl"); |
| 1472 COMPARE(fccmp(s31, s31, NZCVFlag, le), "fccmp s31, s31, #NZCV, le"); | 1482 COMPARE(fccmp(s31, s31, NZCVFlag, le), "fccmp s31, s31, #NZCV, le"); |
| 1473 COMPARE(fccmp(d4, d5, VFlag, gt), "fccmp d4, d5, #nzcV, gt"); | 1483 COMPARE(fccmp(d4, d5, VFlag, gt), "fccmp d4, d5, #nzcV, gt"); |
| 1474 COMPARE(fccmp(d6, d7, NFlag, vs), "fccmp d6, d7, #Nzcv, vs"); | 1484 COMPARE(fccmp(d6, d7, NFlag, vs), "fccmp d6, d7, #Nzcv, vs"); |
| 1475 COMPARE(fccmp(d30, d0, NZFlag, vc), "fccmp d30, d0, #NZcv, vc"); | 1485 COMPARE(fccmp(d30, d0, NZFlag, vc), "fccmp d30, d0, #NZcv, vc"); |
| 1476 COMPARE(fccmp(d31, d31, ZFlag, hs), "fccmp d31, d31, #nZcv, hs"); | 1486 COMPARE(fccmp(d31, d31, ZFlag, hs), "fccmp d31, d31, #nZcv, hs"); |
| 1477 COMPARE(fccmp(s14, s15, CVFlag, al), "fccmp s14, s15, #nzCV, al"); | 1487 COMPARE(fccmp(s14, s15, CVFlag, al), "fccmp s14, s15, #nzCV, al"); |
| 1478 COMPARE(fccmp(d16, d17, CFlag, nv), "fccmp d16, d17, #nzCv, nv"); | 1488 COMPARE(fccmp(d16, d17, CFlag, nv), "fccmp d16, d17, #nzCv, nv"); |
| 1479 | 1489 |
| 1480 CLEANUP(); | 1490 CLEANUP(); |
| 1481 } | 1491 } |
| 1482 | 1492 |
| 1483 | 1493 |
| 1484 TEST_(fp_select) { | 1494 TEST_(fp_select) { |
| 1485 SET_UP(); | 1495 SET_UP_ASM(); |
| 1486 | 1496 |
| 1487 COMPARE(fcsel(s0, s1, s2, eq), "fcsel s0, s1, s2, eq") | 1497 COMPARE(fcsel(s0, s1, s2, eq), "fcsel s0, s1, s2, eq") |
| 1488 COMPARE(fcsel(s31, s31, s30, ne), "fcsel s31, s31, s30, ne"); | 1498 COMPARE(fcsel(s31, s31, s30, ne), "fcsel s31, s31, s30, ne"); |
| 1489 COMPARE(fcsel(d0, d1, d2, mi), "fcsel d0, d1, d2, mi"); | 1499 COMPARE(fcsel(d0, d1, d2, mi), "fcsel d0, d1, d2, mi"); |
| 1490 COMPARE(fcsel(d31, d30, d31, pl), "fcsel d31, d30, d31, pl"); | 1500 COMPARE(fcsel(d31, d30, d31, pl), "fcsel d31, d30, d31, pl"); |
| 1491 COMPARE(fcsel(s14, s15, s16, al), "fcsel s14, s15, s16, al"); | 1501 COMPARE(fcsel(s14, s15, s16, al), "fcsel s14, s15, s16, al"); |
| 1492 COMPARE(fcsel(d17, d18, d19, nv), "fcsel d17, d18, d19, nv"); | 1502 COMPARE(fcsel(d17, d18, d19, nv), "fcsel d17, d18, d19, nv"); |
| 1493 | 1503 |
| 1494 CLEANUP(); | 1504 CLEANUP(); |
| 1495 } | 1505 } |
| 1496 | 1506 |
| 1497 | 1507 |
| 1498 TEST_(fcvt_scvtf_ucvtf) { | 1508 TEST_(fcvt_scvtf_ucvtf) { |
| 1499 SET_UP(); | 1509 SET_UP_ASM(); |
| 1500 | 1510 |
| 1501 COMPARE(fcvtas(w0, s1), "fcvtas w0, s1"); | 1511 COMPARE(fcvtas(w0, s1), "fcvtas w0, s1"); |
| 1502 COMPARE(fcvtas(x2, s3), "fcvtas x2, s3"); | 1512 COMPARE(fcvtas(x2, s3), "fcvtas x2, s3"); |
| 1503 COMPARE(fcvtas(w4, d5), "fcvtas w4, d5"); | 1513 COMPARE(fcvtas(w4, d5), "fcvtas w4, d5"); |
| 1504 COMPARE(fcvtas(x6, d7), "fcvtas x6, d7"); | 1514 COMPARE(fcvtas(x6, d7), "fcvtas x6, d7"); |
| 1505 COMPARE(fcvtau(w8, s9), "fcvtau w8, s9"); | 1515 COMPARE(fcvtau(w8, s9), "fcvtau w8, s9"); |
| 1506 COMPARE(fcvtau(x10, s11), "fcvtau x10, s11"); | 1516 COMPARE(fcvtau(x10, s11), "fcvtau x10, s11"); |
| 1507 COMPARE(fcvtau(w12, d13), "fcvtau w12, d13"); | 1517 COMPARE(fcvtau(w12, d13), "fcvtau w12, d13"); |
| 1508 COMPARE(fcvtau(x14, d15), "fcvtau x14, d15"); | 1518 COMPARE(fcvtau(x14, d15), "fcvtau x14, d15"); |
| 1509 COMPARE(fcvtns(w0, s1), "fcvtns w0, s1"); | 1519 COMPARE(fcvtns(w0, s1), "fcvtns w0, s1"); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 COMPARE(fcvtmu(w8, s9), "fcvtmu w8, s9"); | 1561 COMPARE(fcvtmu(w8, s9), "fcvtmu w8, s9"); |
| 1552 COMPARE(fcvtmu(x10, s11), "fcvtmu x10, s11"); | 1562 COMPARE(fcvtmu(x10, s11), "fcvtmu x10, s11"); |
| 1553 COMPARE(fcvtmu(w12, d13), "fcvtmu w12, d13"); | 1563 COMPARE(fcvtmu(w12, d13), "fcvtmu w12, d13"); |
| 1554 COMPARE(fcvtmu(x14, d15), "fcvtmu x14, d15"); | 1564 COMPARE(fcvtmu(x14, d15), "fcvtmu x14, d15"); |
| 1555 | 1565 |
| 1556 CLEANUP(); | 1566 CLEANUP(); |
| 1557 } | 1567 } |
| 1558 | 1568 |
| 1559 | 1569 |
| 1560 TEST_(system_mrs) { | 1570 TEST_(system_mrs) { |
| 1561 SET_UP(); | 1571 SET_UP_ASM(); |
| 1562 | 1572 |
| 1563 COMPARE(mrs(x0, NZCV), "mrs x0, nzcv"); | 1573 COMPARE(mrs(x0, NZCV), "mrs x0, nzcv"); |
| 1564 COMPARE(mrs(lr, NZCV), "mrs lr, nzcv"); | 1574 COMPARE(mrs(lr, NZCV), "mrs lr, nzcv"); |
| 1565 COMPARE(mrs(x15, FPCR), "mrs x15, fpcr"); | 1575 COMPARE(mrs(x15, FPCR), "mrs x15, fpcr"); |
| 1566 | 1576 |
| 1567 CLEANUP(); | 1577 CLEANUP(); |
| 1568 } | 1578 } |
| 1569 | 1579 |
| 1570 | 1580 |
| 1571 TEST_(system_msr) { | 1581 TEST_(system_msr) { |
| 1572 SET_UP(); | 1582 SET_UP_ASM(); |
| 1573 | 1583 |
| 1574 COMPARE(msr(NZCV, x0), "msr nzcv, x0"); | 1584 COMPARE(msr(NZCV, x0), "msr nzcv, x0"); |
| 1575 COMPARE(msr(NZCV, x30), "msr nzcv, lr"); | 1585 COMPARE(msr(NZCV, x30), "msr nzcv, lr"); |
| 1576 COMPARE(msr(FPCR, x15), "msr fpcr, x15"); | 1586 COMPARE(msr(FPCR, x15), "msr fpcr, x15"); |
| 1577 | 1587 |
| 1578 CLEANUP(); | 1588 CLEANUP(); |
| 1579 } | 1589 } |
| 1580 | 1590 |
| 1581 | 1591 |
| 1582 TEST_(system_nop) { | 1592 TEST_(system_nop) { |
| 1583 SET_UP(); | 1593 SET_UP_ASM(); |
| 1584 | 1594 |
| 1585 COMPARE(nop(), "nop"); | 1595 COMPARE(nop(), "nop"); |
| 1586 | 1596 |
| 1587 CLEANUP(); | 1597 CLEANUP(); |
| 1588 } | 1598 } |
| 1589 | 1599 |
| 1590 | 1600 |
| 1591 TEST_(debug) { | 1601 TEST_(debug) { |
| 1592 SET_UP(); | 1602 SET_UP_ASM(); |
| 1593 | 1603 |
| 1594 DCHECK(kImmExceptionIsDebug == 0xdeb0); | 1604 DCHECK(kImmExceptionIsDebug == 0xdeb0); |
| 1595 | 1605 |
| 1596 // All debug codes should produce the same instruction, and the debug code | 1606 // All debug codes should produce the same instruction, and the debug code |
| 1597 // can be any uint32_t. | 1607 // can be any uint32_t. |
| 1598 COMPARE(debug("message", 0, BREAK), "hlt #0xdeb0"); | 1608 COMPARE(debug("message", 0, BREAK), "hlt #0xdeb0"); |
| 1599 COMPARE(debug("message", 1, BREAK), "hlt #0xdeb0"); | 1609 COMPARE(debug("message", 1, BREAK), "hlt #0xdeb0"); |
| 1600 COMPARE(debug("message", 0xffff, BREAK), "hlt #0xdeb0"); | 1610 COMPARE(debug("message", 0xffff, BREAK), "hlt #0xdeb0"); |
| 1601 COMPARE(debug("message", 0x10000, BREAK), "hlt #0xdeb0"); | 1611 COMPARE(debug("message", 0x10000, BREAK), "hlt #0xdeb0"); |
| 1602 COMPARE(debug("message", 0x7fffffff, BREAK), "hlt #0xdeb0"); | 1612 COMPARE(debug("message", 0x7fffffff, BREAK), "hlt #0xdeb0"); |
| 1603 COMPARE(debug("message", 0x80000000u, BREAK), "hlt #0xdeb0"); | 1613 COMPARE(debug("message", 0x80000000u, BREAK), "hlt #0xdeb0"); |
| 1604 COMPARE(debug("message", 0xffffffffu, BREAK), "hlt #0xdeb0"); | 1614 COMPARE(debug("message", 0xffffffffu, BREAK), "hlt #0xdeb0"); |
| 1605 | 1615 |
| 1606 CLEANUP(); | 1616 CLEANUP(); |
| 1607 } | 1617 } |
| 1608 | 1618 |
| 1609 | 1619 |
| 1610 TEST_(hlt) { | 1620 TEST_(hlt) { |
| 1611 SET_UP(); | 1621 SET_UP_ASM(); |
| 1612 | 1622 |
| 1613 COMPARE(hlt(0), "hlt #0x0"); | 1623 COMPARE(hlt(0), "hlt #0x0"); |
| 1614 COMPARE(hlt(1), "hlt #0x1"); | 1624 COMPARE(hlt(1), "hlt #0x1"); |
| 1615 COMPARE(hlt(65535), "hlt #0xffff"); | 1625 COMPARE(hlt(65535), "hlt #0xffff"); |
| 1616 | 1626 |
| 1617 CLEANUP(); | 1627 CLEANUP(); |
| 1618 } | 1628 } |
| 1619 | 1629 |
| 1620 | 1630 |
| 1621 TEST_(brk) { | 1631 TEST_(brk) { |
| 1622 SET_UP(); | 1632 SET_UP_ASM(); |
| 1623 | 1633 |
| 1624 COMPARE(brk(0), "brk #0x0"); | 1634 COMPARE(brk(0), "brk #0x0"); |
| 1625 COMPARE(brk(1), "brk #0x1"); | 1635 COMPARE(brk(1), "brk #0x1"); |
| 1626 COMPARE(brk(65535), "brk #0xffff"); | 1636 COMPARE(brk(65535), "brk #0xffff"); |
| 1627 | 1637 |
| 1628 CLEANUP(); | 1638 CLEANUP(); |
| 1629 } | 1639 } |
| 1630 | 1640 |
| 1631 | 1641 |
| 1632 TEST_(add_sub_negative) { | 1642 TEST_(add_sub_negative) { |
| 1633 SET_UP_CLASS(MacroAssembler); | 1643 SET_UP_MASM(); |
| 1634 | 1644 |
| 1635 COMPARE(Add(x10, x0, -42), "sub x10, x0, #0x2a (42)"); | 1645 COMPARE(Add(x10, x0, -42), "sub x10, x0, #0x2a (42)"); |
| 1636 COMPARE(Add(x11, x1, -687), "sub x11, x1, #0x2af (687)"); | 1646 COMPARE(Add(x11, x1, -687), "sub x11, x1, #0x2af (687)"); |
| 1637 COMPARE(Add(x12, x2, -0x88), "sub x12, x2, #0x88 (136)"); | 1647 COMPARE(Add(x12, x2, -0x88), "sub x12, x2, #0x88 (136)"); |
| 1638 | 1648 |
| 1639 COMPARE(Sub(x13, x0, -600), "add x13, x0, #0x258 (600)"); | 1649 COMPARE(Sub(x13, x0, -600), "add x13, x0, #0x258 (600)"); |
| 1640 COMPARE(Sub(x14, x1, -313), "add x14, x1, #0x139 (313)"); | 1650 COMPARE(Sub(x14, x1, -313), "add x14, x1, #0x139 (313)"); |
| 1641 COMPARE(Sub(x15, x2, -0x555), "add x15, x2, #0x555 (1365)"); | 1651 COMPARE(Sub(x15, x2, -0x555), "add x15, x2, #0x555 (1365)"); |
| 1642 | 1652 |
| 1643 COMPARE(Add(w19, w3, -0x344), "sub w19, w3, #0x344 (836)"); | 1653 COMPARE(Add(w19, w3, -0x344), "sub w19, w3, #0x344 (836)"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1654 COMPARE(Cmn(w0, -1), "cmp w0, #0x1 (1)"); | 1664 COMPARE(Cmn(w0, -1), "cmp w0, #0x1 (1)"); |
| 1655 COMPARE(Cmn(x1, -1), "cmp x1, #0x1 (1)"); | 1665 COMPARE(Cmn(x1, -1), "cmp x1, #0x1 (1)"); |
| 1656 COMPARE(Cmn(w2, -4095), "cmp w2, #0xfff (4095)"); | 1666 COMPARE(Cmn(w2, -4095), "cmp w2, #0xfff (4095)"); |
| 1657 COMPARE(Cmn(x3, -4095), "cmp x3, #0xfff (4095)"); | 1667 COMPARE(Cmn(x3, -4095), "cmp x3, #0xfff (4095)"); |
| 1658 | 1668 |
| 1659 CLEANUP(); | 1669 CLEANUP(); |
| 1660 } | 1670 } |
| 1661 | 1671 |
| 1662 | 1672 |
| 1663 TEST_(logical_immediate_move) { | 1673 TEST_(logical_immediate_move) { |
| 1664 SET_UP_CLASS(MacroAssembler); | 1674 SET_UP_MASM(); |
| 1665 | 1675 |
| 1666 COMPARE(And(w0, w1, 0), "movz w0, #0x0"); | 1676 COMPARE(And(w0, w1, 0), "movz w0, #0x0"); |
| 1667 COMPARE(And(x0, x1, 0), "movz x0, #0x0"); | 1677 COMPARE(And(x0, x1, 0), "movz x0, #0x0"); |
| 1668 COMPARE(Orr(w2, w3, 0), "mov w2, w3"); | 1678 COMPARE(Orr(w2, w3, 0), "mov w2, w3"); |
| 1669 COMPARE(Orr(x2, x3, 0), "mov x2, x3"); | 1679 COMPARE(Orr(x2, x3, 0), "mov x2, x3"); |
| 1670 COMPARE(Eor(w4, w5, 0), "mov w4, w5"); | 1680 COMPARE(Eor(w4, w5, 0), "mov w4, w5"); |
| 1671 COMPARE(Eor(x4, x5, 0), "mov x4, x5"); | 1681 COMPARE(Eor(x4, x5, 0), "mov x4, x5"); |
| 1672 COMPARE(Bic(w6, w7, 0), "mov w6, w7"); | 1682 COMPARE(Bic(w6, w7, 0), "mov w6, w7"); |
| 1673 COMPARE(Bic(x6, x7, 0), "mov x6, x7"); | 1683 COMPARE(Bic(x6, x7, 0), "mov x6, x7"); |
| 1674 COMPARE(Orn(w8, w9, 0), "movn w8, #0x0"); | 1684 COMPARE(Orn(w8, w9, 0), "movn w8, #0x0"); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1693 COMPARE(Orn(x20, x21, 0xffffffffffffffff), "mov x20, x21"); | 1703 COMPARE(Orn(x20, x21, 0xffffffffffffffff), "mov x20, x21"); |
| 1694 COMPARE(Eon(w22, w23, 0xffffffff), "mov w22, w23"); | 1704 COMPARE(Eon(w22, w23, 0xffffffff), "mov w22, w23"); |
| 1695 COMPARE(Eon(x22, x23, 0xffffffff), "eor x22, x23, #0xffffffff00000000"); | 1705 COMPARE(Eon(x22, x23, 0xffffffff), "eor x22, x23, #0xffffffff00000000"); |
| 1696 COMPARE(Eon(x22, x23, 0xffffffffffffffff), "mov x22, x23"); | 1706 COMPARE(Eon(x22, x23, 0xffffffffffffffff), "mov x22, x23"); |
| 1697 | 1707 |
| 1698 CLEANUP(); | 1708 CLEANUP(); |
| 1699 } | 1709 } |
| 1700 | 1710 |
| 1701 | 1711 |
| 1702 TEST_(barriers) { | 1712 TEST_(barriers) { |
| 1703 SET_UP_CLASS(MacroAssembler); | 1713 SET_UP_MASM(); |
| 1704 | 1714 |
| 1705 // DMB | 1715 // DMB |
| 1706 COMPARE(Dmb(FullSystem, BarrierAll), "dmb sy"); | 1716 COMPARE(Dmb(FullSystem, BarrierAll), "dmb sy"); |
| 1707 COMPARE(Dmb(FullSystem, BarrierReads), "dmb ld"); | 1717 COMPARE(Dmb(FullSystem, BarrierReads), "dmb ld"); |
| 1708 COMPARE(Dmb(FullSystem, BarrierWrites), "dmb st"); | 1718 COMPARE(Dmb(FullSystem, BarrierWrites), "dmb st"); |
| 1709 | 1719 |
| 1710 COMPARE(Dmb(InnerShareable, BarrierAll), "dmb ish"); | 1720 COMPARE(Dmb(InnerShareable, BarrierAll), "dmb ish"); |
| 1711 COMPARE(Dmb(InnerShareable, BarrierReads), "dmb ishld"); | 1721 COMPARE(Dmb(InnerShareable, BarrierReads), "dmb ishld"); |
| 1712 COMPARE(Dmb(InnerShareable, BarrierWrites), "dmb ishst"); | 1722 COMPARE(Dmb(InnerShareable, BarrierWrites), "dmb ishst"); |
| 1713 | 1723 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1744 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)"); | 1754 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)"); |
| 1745 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)"); | 1755 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)"); |
| 1746 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)"); | 1756 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)"); |
| 1747 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)"); | 1757 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)"); |
| 1748 | 1758 |
| 1749 // ISB | 1759 // ISB |
| 1750 COMPARE(Isb(), "isb"); | 1760 COMPARE(Isb(), "isb"); |
| 1751 | 1761 |
| 1752 CLEANUP(); | 1762 CLEANUP(); |
| 1753 } | 1763 } |
| OLD | NEW |