diff options
Diffstat (limited to 'llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp | 571 |
1 files changed, 0 insertions, 571 deletions
diff --git a/llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp b/llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp index f53592a73aa..a7be9532fe8 100644 --- a/llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp +++ b/llvm/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp @@ -143,13 +143,6 @@ static DecodeStatus DecodeSystemPStateInstruction(llvm::MCInst &Inst, const void *Decoder); static DecodeStatus DecodeTestAndBranch(llvm::MCInst &Inst, uint32_t insn, uint64_t Address, const void *Decoder); -static DecodeStatus DecodeSIMDLdStPost(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, const void *Decoder); -static DecodeStatus DecodeSIMDLdStSingle(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, const void *Decoder); -static DecodeStatus DecodeSIMDLdStSingleTied(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, - const void *Decoder); static DecodeStatus DecodeVecShiftR64Imm(llvm::MCInst &Inst, unsigned Imm, uint64_t Addr, const void *Decoder); @@ -1455,567 +1448,3 @@ static DecodeStatus DecodeTestAndBranch(llvm::MCInst &Inst, uint32_t insn, return Success; } - -static DecodeStatus DecodeSIMDLdStPost(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, const void *Decoder) { - uint64_t Rd = fieldFromInstruction(insn, 0, 5); - uint64_t Rn = fieldFromInstruction(insn, 5, 5); - uint64_t Rm = fieldFromInstruction(insn, 16, 5); - - switch (Inst.getOpcode()) { - default: - return Fail; - case ARM64::ST1Onev8b_POST: - case ARM64::ST1Onev4h_POST: - case ARM64::ST1Onev2s_POST: - case ARM64::ST1Onev1d_POST: - case ARM64::LD1Onev8b_POST: - case ARM64::LD1Onev4h_POST: - case ARM64::LD1Onev2s_POST: - case ARM64::LD1Onev1d_POST: - DecodeFPR64RegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Onev16b_POST: - case ARM64::ST1Onev8h_POST: - case ARM64::ST1Onev4s_POST: - case ARM64::ST1Onev2d_POST: - case ARM64::LD1Onev16b_POST: - case ARM64::LD1Onev8h_POST: - case ARM64::LD1Onev4s_POST: - case ARM64::LD1Onev2d_POST: - DecodeFPR128RegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Twov8b_POST: - case ARM64::ST1Twov4h_POST: - case ARM64::ST1Twov2s_POST: - case ARM64::ST1Twov1d_POST: - case ARM64::ST2Twov8b_POST: - case ARM64::ST2Twov4h_POST: - case ARM64::ST2Twov2s_POST: - case ARM64::LD1Twov8b_POST: - case ARM64::LD1Twov4h_POST: - case ARM64::LD1Twov2s_POST: - case ARM64::LD1Twov1d_POST: - case ARM64::LD2Twov8b_POST: - case ARM64::LD2Twov4h_POST: - case ARM64::LD2Twov2s_POST: - DecodeDDRegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Threev8b_POST: - case ARM64::ST1Threev4h_POST: - case ARM64::ST1Threev2s_POST: - case ARM64::ST1Threev1d_POST: - case ARM64::ST3Threev8b_POST: - case ARM64::ST3Threev4h_POST: - case ARM64::ST3Threev2s_POST: - case ARM64::LD1Threev8b_POST: - case ARM64::LD1Threev4h_POST: - case ARM64::LD1Threev2s_POST: - case ARM64::LD1Threev1d_POST: - case ARM64::LD3Threev8b_POST: - case ARM64::LD3Threev4h_POST: - case ARM64::LD3Threev2s_POST: - DecodeDDDRegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Fourv8b_POST: - case ARM64::ST1Fourv4h_POST: - case ARM64::ST1Fourv2s_POST: - case ARM64::ST1Fourv1d_POST: - case ARM64::ST4Fourv8b_POST: - case ARM64::ST4Fourv4h_POST: - case ARM64::ST4Fourv2s_POST: - case ARM64::LD1Fourv8b_POST: - case ARM64::LD1Fourv4h_POST: - case ARM64::LD1Fourv2s_POST: - case ARM64::LD1Fourv1d_POST: - case ARM64::LD4Fourv8b_POST: - case ARM64::LD4Fourv4h_POST: - case ARM64::LD4Fourv2s_POST: - DecodeDDDDRegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Twov16b_POST: - case ARM64::ST1Twov8h_POST: - case ARM64::ST1Twov4s_POST: - case ARM64::ST1Twov2d_POST: - case ARM64::ST2Twov16b_POST: - case ARM64::ST2Twov8h_POST: - case ARM64::ST2Twov4s_POST: - case ARM64::ST2Twov2d_POST: - case ARM64::LD1Twov16b_POST: - case ARM64::LD1Twov8h_POST: - case ARM64::LD1Twov4s_POST: - case ARM64::LD1Twov2d_POST: - case ARM64::LD2Twov16b_POST: - case ARM64::LD2Twov8h_POST: - case ARM64::LD2Twov4s_POST: - case ARM64::LD2Twov2d_POST: - DecodeQQRegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Threev16b_POST: - case ARM64::ST1Threev8h_POST: - case ARM64::ST1Threev4s_POST: - case ARM64::ST1Threev2d_POST: - case ARM64::ST3Threev16b_POST: - case ARM64::ST3Threev8h_POST: - case ARM64::ST3Threev4s_POST: - case ARM64::ST3Threev2d_POST: - case ARM64::LD1Threev16b_POST: - case ARM64::LD1Threev8h_POST: - case ARM64::LD1Threev4s_POST: - case ARM64::LD1Threev2d_POST: - case ARM64::LD3Threev16b_POST: - case ARM64::LD3Threev8h_POST: - case ARM64::LD3Threev4s_POST: - case ARM64::LD3Threev2d_POST: - DecodeQQQRegisterClass(Inst, Rd, Addr, Decoder); - break; - case ARM64::ST1Fourv16b_POST: - case ARM64::ST1Fourv8h_POST: - case ARM64::ST1Fourv4s_POST: - case ARM64::ST1Fourv2d_POST: - case ARM64::ST4Fourv16b_POST: - case ARM64::ST4Fourv8h_POST: - case ARM64::ST4Fourv4s_POST: - case ARM64::ST4Fourv2d_POST: - case ARM64::LD1Fourv16b_POST: - case ARM64::LD1Fourv8h_POST: - case ARM64::LD1Fourv4s_POST: - case ARM64::LD1Fourv2d_POST: - case ARM64::LD4Fourv16b_POST: - case ARM64::LD4Fourv8h_POST: - case ARM64::LD4Fourv4s_POST: - case ARM64::LD4Fourv2d_POST: - DecodeQQQQRegisterClass(Inst, Rd, Addr, Decoder); - break; - } - - DecodeGPR64spRegisterClass(Inst, Rn, Addr, Decoder); - DecodeGPR64RegisterClass(Inst, Rm, Addr, Decoder); - return Success; -} - -static DecodeStatus DecodeSIMDLdStSingle(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, const void *Decoder) { - uint64_t Rt = fieldFromInstruction(insn, 0, 5); - uint64_t Rn = fieldFromInstruction(insn, 5, 5); - uint64_t Rm = fieldFromInstruction(insn, 16, 5); - uint64_t size = fieldFromInstruction(insn, 10, 2); - uint64_t S = fieldFromInstruction(insn, 12, 1); - uint64_t Q = fieldFromInstruction(insn, 30, 1); - uint64_t index = 0; - - switch (Inst.getOpcode()) { - case ARM64::ST1i8: - case ARM64::ST1i8_POST: - case ARM64::ST2i8: - case ARM64::ST2i8_POST: - case ARM64::ST3i8_POST: - case ARM64::ST3i8: - case ARM64::ST4i8_POST: - case ARM64::ST4i8: - index = (Q << 3) | (S << 2) | size; - break; - case ARM64::ST1i16: - case ARM64::ST1i16_POST: - case ARM64::ST2i16: - case ARM64::ST2i16_POST: - case ARM64::ST3i16_POST: - case ARM64::ST3i16: - case ARM64::ST4i16_POST: - case ARM64::ST4i16: - index = (Q << 2) | (S << 1) | (size >> 1); - break; - case ARM64::ST1i32: - case ARM64::ST1i32_POST: - case ARM64::ST2i32: - case ARM64::ST2i32_POST: - case ARM64::ST3i32_POST: - case ARM64::ST3i32: - case ARM64::ST4i32_POST: - case ARM64::ST4i32: - index = (Q << 1) | S; - break; - case ARM64::ST1i64: - case ARM64::ST1i64_POST: - case ARM64::ST2i64: - case ARM64::ST2i64_POST: - case ARM64::ST3i64_POST: - case ARM64::ST3i64: - case ARM64::ST4i64_POST: - case ARM64::ST4i64: - index = Q; - break; - } - - switch (Inst.getOpcode()) { - default: - return Fail; - case ARM64::LD1Rv8b: - case ARM64::LD1Rv8b_POST: - case ARM64::LD1Rv4h: - case ARM64::LD1Rv4h_POST: - case ARM64::LD1Rv2s: - case ARM64::LD1Rv2s_POST: - case ARM64::LD1Rv1d: - case ARM64::LD1Rv1d_POST: - DecodeFPR64RegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD1Rv16b: - case ARM64::LD1Rv16b_POST: - case ARM64::LD1Rv8h: - case ARM64::LD1Rv8h_POST: - case ARM64::LD1Rv4s: - case ARM64::LD1Rv4s_POST: - case ARM64::LD1Rv2d: - case ARM64::LD1Rv2d_POST: - case ARM64::ST1i8: - case ARM64::ST1i8_POST: - case ARM64::ST1i16: - case ARM64::ST1i16_POST: - case ARM64::ST1i32: - case ARM64::ST1i32_POST: - case ARM64::ST1i64: - case ARM64::ST1i64_POST: - DecodeFPR128RegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD2Rv16b: - case ARM64::LD2Rv16b_POST: - case ARM64::LD2Rv8h: - case ARM64::LD2Rv8h_POST: - case ARM64::LD2Rv4s: - case ARM64::LD2Rv4s_POST: - case ARM64::LD2Rv2d: - case ARM64::LD2Rv2d_POST: - case ARM64::ST2i8: - case ARM64::ST2i8_POST: - case ARM64::ST2i16: - case ARM64::ST2i16_POST: - case ARM64::ST2i32: - case ARM64::ST2i32_POST: - case ARM64::ST2i64: - case ARM64::ST2i64_POST: - DecodeQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD2Rv8b: - case ARM64::LD2Rv8b_POST: - case ARM64::LD2Rv4h: - case ARM64::LD2Rv4h_POST: - case ARM64::LD2Rv2s: - case ARM64::LD2Rv2s_POST: - case ARM64::LD2Rv1d: - case ARM64::LD2Rv1d_POST: - DecodeDDRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD3Rv8b: - case ARM64::LD3Rv8b_POST: - case ARM64::LD3Rv4h: - case ARM64::LD3Rv4h_POST: - case ARM64::LD3Rv2s: - case ARM64::LD3Rv2s_POST: - case ARM64::LD3Rv1d: - case ARM64::LD3Rv1d_POST: - DecodeDDDRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD3Rv16b: - case ARM64::LD3Rv16b_POST: - case ARM64::LD3Rv8h: - case ARM64::LD3Rv8h_POST: - case ARM64::LD3Rv4s: - case ARM64::LD3Rv4s_POST: - case ARM64::LD3Rv2d: - case ARM64::LD3Rv2d_POST: - case ARM64::ST3i8: - case ARM64::ST3i8_POST: - case ARM64::ST3i16: - case ARM64::ST3i16_POST: - case ARM64::ST3i32: - case ARM64::ST3i32_POST: - case ARM64::ST3i64: - case ARM64::ST3i64_POST: - DecodeQQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD4Rv8b: - case ARM64::LD4Rv8b_POST: - case ARM64::LD4Rv4h: - case ARM64::LD4Rv4h_POST: - case ARM64::LD4Rv2s: - case ARM64::LD4Rv2s_POST: - case ARM64::LD4Rv1d: - case ARM64::LD4Rv1d_POST: - DecodeDDDDRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD4Rv16b: - case ARM64::LD4Rv16b_POST: - case ARM64::LD4Rv8h: - case ARM64::LD4Rv8h_POST: - case ARM64::LD4Rv4s: - case ARM64::LD4Rv4s_POST: - case ARM64::LD4Rv2d: - case ARM64::LD4Rv2d_POST: - case ARM64::ST4i8: - case ARM64::ST4i8_POST: - case ARM64::ST4i16: - case ARM64::ST4i16_POST: - case ARM64::ST4i32: - case ARM64::ST4i32_POST: - case ARM64::ST4i64: - case ARM64::ST4i64_POST: - DecodeQQQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - } - - switch (Inst.getOpcode()) { - case ARM64::LD1Rv8b: - case ARM64::LD1Rv8b_POST: - case ARM64::LD1Rv16b: - case ARM64::LD1Rv16b_POST: - case ARM64::LD1Rv4h: - case ARM64::LD1Rv4h_POST: - case ARM64::LD1Rv8h: - case ARM64::LD1Rv8h_POST: - case ARM64::LD1Rv4s: - case ARM64::LD1Rv4s_POST: - case ARM64::LD1Rv2s: - case ARM64::LD1Rv2s_POST: - case ARM64::LD1Rv1d: - case ARM64::LD1Rv1d_POST: - case ARM64::LD1Rv2d: - case ARM64::LD1Rv2d_POST: - case ARM64::LD2Rv8b: - case ARM64::LD2Rv8b_POST: - case ARM64::LD2Rv16b: - case ARM64::LD2Rv16b_POST: - case ARM64::LD2Rv4h: - case ARM64::LD2Rv4h_POST: - case ARM64::LD2Rv8h: - case ARM64::LD2Rv8h_POST: - case ARM64::LD2Rv2s: - case ARM64::LD2Rv2s_POST: - case ARM64::LD2Rv4s: - case ARM64::LD2Rv4s_POST: - case ARM64::LD2Rv2d: - case ARM64::LD2Rv2d_POST: - case ARM64::LD2Rv1d: - case ARM64::LD2Rv1d_POST: - case ARM64::LD3Rv8b: - case ARM64::LD3Rv8b_POST: - case ARM64::LD3Rv16b: - case ARM64::LD3Rv16b_POST: - case ARM64::LD3Rv4h: - case ARM64::LD3Rv4h_POST: - case ARM64::LD3Rv8h: - case ARM64::LD3Rv8h_POST: - case ARM64::LD3Rv2s: - case ARM64::LD3Rv2s_POST: - case ARM64::LD3Rv4s: - case ARM64::LD3Rv4s_POST: - case ARM64::LD3Rv2d: - case ARM64::LD3Rv2d_POST: - case ARM64::LD3Rv1d: - case ARM64::LD3Rv1d_POST: - case ARM64::LD4Rv8b: - case ARM64::LD4Rv8b_POST: - case ARM64::LD4Rv16b: - case ARM64::LD4Rv16b_POST: - case ARM64::LD4Rv4h: - case ARM64::LD4Rv4h_POST: - case ARM64::LD4Rv8h: - case ARM64::LD4Rv8h_POST: - case ARM64::LD4Rv2s: - case ARM64::LD4Rv2s_POST: - case ARM64::LD4Rv4s: - case ARM64::LD4Rv4s_POST: - case ARM64::LD4Rv2d: - case ARM64::LD4Rv2d_POST: - case ARM64::LD4Rv1d: - case ARM64::LD4Rv1d_POST: - break; - default: - Inst.addOperand(MCOperand::CreateImm(index)); - } - - DecodeGPR64spRegisterClass(Inst, Rn, Addr, Decoder); - - switch (Inst.getOpcode()) { - case ARM64::ST1i8_POST: - case ARM64::ST1i16_POST: - case ARM64::ST1i32_POST: - case ARM64::ST1i64_POST: - case ARM64::LD1Rv8b_POST: - case ARM64::LD1Rv16b_POST: - case ARM64::LD1Rv4h_POST: - case ARM64::LD1Rv8h_POST: - case ARM64::LD1Rv2s_POST: - case ARM64::LD1Rv4s_POST: - case ARM64::LD1Rv1d_POST: - case ARM64::LD1Rv2d_POST: - case ARM64::ST2i8_POST: - case ARM64::ST2i16_POST: - case ARM64::ST2i32_POST: - case ARM64::ST2i64_POST: - case ARM64::LD2Rv8b_POST: - case ARM64::LD2Rv16b_POST: - case ARM64::LD2Rv4h_POST: - case ARM64::LD2Rv8h_POST: - case ARM64::LD2Rv2s_POST: - case ARM64::LD2Rv4s_POST: - case ARM64::LD2Rv2d_POST: - case ARM64::LD2Rv1d_POST: - case ARM64::ST3i8_POST: - case ARM64::ST3i16_POST: - case ARM64::ST3i32_POST: - case ARM64::ST3i64_POST: - case ARM64::LD3Rv8b_POST: - case ARM64::LD3Rv16b_POST: - case ARM64::LD3Rv4h_POST: - case ARM64::LD3Rv8h_POST: - case ARM64::LD3Rv2s_POST: - case ARM64::LD3Rv4s_POST: - case ARM64::LD3Rv2d_POST: - case ARM64::LD3Rv1d_POST: - case ARM64::ST4i8_POST: - case ARM64::ST4i16_POST: - case ARM64::ST4i32_POST: - case ARM64::ST4i64_POST: - case ARM64::LD4Rv8b_POST: - case ARM64::LD4Rv16b_POST: - case ARM64::LD4Rv4h_POST: - case ARM64::LD4Rv8h_POST: - case ARM64::LD4Rv2s_POST: - case ARM64::LD4Rv4s_POST: - case ARM64::LD4Rv2d_POST: - case ARM64::LD4Rv1d_POST: - DecodeGPR64RegisterClass(Inst, Rm, Addr, Decoder); - break; - } - return Success; -} - -static DecodeStatus DecodeSIMDLdStSingleTied(llvm::MCInst &Inst, uint32_t insn, - uint64_t Addr, - const void *Decoder) { - uint64_t Rt = fieldFromInstruction(insn, 0, 5); - uint64_t Rn = fieldFromInstruction(insn, 5, 5); - uint64_t Rm = fieldFromInstruction(insn, 16, 5); - uint64_t size = fieldFromInstruction(insn, 10, 2); - uint64_t S = fieldFromInstruction(insn, 12, 1); - uint64_t Q = fieldFromInstruction(insn, 30, 1); - uint64_t index = 0; - - switch (Inst.getOpcode()) { - case ARM64::LD1i8: - case ARM64::LD1i8_POST: - case ARM64::LD2i8: - case ARM64::LD2i8_POST: - case ARM64::LD3i8_POST: - case ARM64::LD3i8: - case ARM64::LD4i8_POST: - case ARM64::LD4i8: - index = (Q << 3) | (S << 2) | size; - break; - case ARM64::LD1i16: - case ARM64::LD1i16_POST: - case ARM64::LD2i16: - case ARM64::LD2i16_POST: - case ARM64::LD3i16_POST: - case ARM64::LD3i16: - case ARM64::LD4i16_POST: - case ARM64::LD4i16: - index = (Q << 2) | (S << 1) | (size >> 1); - break; - case ARM64::LD1i32: - case ARM64::LD1i32_POST: - case ARM64::LD2i32: - case ARM64::LD2i32_POST: - case ARM64::LD3i32_POST: - case ARM64::LD3i32: - case ARM64::LD4i32_POST: - case ARM64::LD4i32: - index = (Q << 1) | S; - break; - case ARM64::LD1i64: - case ARM64::LD1i64_POST: - case ARM64::LD2i64: - case ARM64::LD2i64_POST: - case ARM64::LD3i64_POST: - case ARM64::LD3i64: - case ARM64::LD4i64_POST: - case ARM64::LD4i64: - index = Q; - break; - } - - switch (Inst.getOpcode()) { - default: - return Fail; - case ARM64::LD1i8: - case ARM64::LD1i8_POST: - case ARM64::LD1i16: - case ARM64::LD1i16_POST: - case ARM64::LD1i32: - case ARM64::LD1i32_POST: - case ARM64::LD1i64: - case ARM64::LD1i64_POST: - DecodeFPR128RegisterClass(Inst, Rt, Addr, Decoder); - DecodeFPR128RegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD2i8: - case ARM64::LD2i8_POST: - case ARM64::LD2i16: - case ARM64::LD2i16_POST: - case ARM64::LD2i32: - case ARM64::LD2i32_POST: - case ARM64::LD2i64: - case ARM64::LD2i64_POST: - DecodeQQRegisterClass(Inst, Rt, Addr, Decoder); - DecodeQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD3i8: - case ARM64::LD3i8_POST: - case ARM64::LD3i16: - case ARM64::LD3i16_POST: - case ARM64::LD3i32: - case ARM64::LD3i32_POST: - case ARM64::LD3i64: - case ARM64::LD3i64_POST: - DecodeQQQRegisterClass(Inst, Rt, Addr, Decoder); - DecodeQQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - case ARM64::LD4i8: - case ARM64::LD4i8_POST: - case ARM64::LD4i16: - case ARM64::LD4i16_POST: - case ARM64::LD4i32: - case ARM64::LD4i32_POST: - case ARM64::LD4i64: - case ARM64::LD4i64_POST: - DecodeQQQQRegisterClass(Inst, Rt, Addr, Decoder); - DecodeQQQQRegisterClass(Inst, Rt, Addr, Decoder); - break; - } - - Inst.addOperand(MCOperand::CreateImm(index)); - DecodeGPR64spRegisterClass(Inst, Rn, Addr, Decoder); - - switch (Inst.getOpcode()) { - case ARM64::LD1i8_POST: - case ARM64::LD1i16_POST: - case ARM64::LD1i32_POST: - case ARM64::LD1i64_POST: - case ARM64::LD2i8_POST: - case ARM64::LD2i16_POST: - case ARM64::LD2i32_POST: - case ARM64::LD2i64_POST: - case ARM64::LD3i8_POST: - case ARM64::LD3i16_POST: - case ARM64::LD3i32_POST: - case ARM64::LD3i64_POST: - case ARM64::LD4i8_POST: - case ARM64::LD4i16_POST: - case ARM64::LD4i32_POST: - case ARM64::LD4i64_POST: - DecodeGPR64RegisterClass(Inst, Rm, Addr, Decoder); - break; - } - return Success; -} |

