Index: llvm/trunk/lib/Target/Mips/Disassembler/MipsDisassembler.cpp =================================================================== --- llvm/trunk/lib/Target/Mips/Disassembler/MipsDisassembler.cpp +++ llvm/trunk/lib/Target/Mips/Disassembler/MipsDisassembler.cpp @@ -580,7 +580,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; bool HasRs = false; if (Rs >= Rt) { @@ -619,7 +619,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; bool HasRs = false; if (Rs >= Rt) { @@ -659,7 +659,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; bool HasRs = false; if (Rt == 0) @@ -704,7 +704,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; if (Rt == 0) return MCDisassembler::Fail; @@ -746,7 +746,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; bool HasRs = false; bool HasRt = false; @@ -795,7 +795,7 @@ InsnType Rs = fieldFromInstruction(insn, 21, 5); InsnType Rt = fieldFromInstruction(insn, 16, 5); - InsnType Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4; + int64_t Imm = SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4; bool HasRs = false; if (Rt == 0) @@ -1860,7 +1860,7 @@ unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = SignExtend32<21>(Offset) * 4; + int32_t BranchOffset = SignExtend32<21>(Offset) * 4 + 4; Inst.addOperand(MCOperand::createImm(BranchOffset)); return MCDisassembler::Success; @@ -1880,7 +1880,7 @@ unsigned Offset, uint64_t Address, const void *Decoder) { - int32_t BranchOffset = SignExtend32<26>(Offset) * 4; + int32_t BranchOffset = SignExtend32<26>(Offset) * 4 + 4; Inst.addOperand(MCOperand::createImm(BranchOffset)); return MCDisassembler::Success; Index: llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s =================================================================== --- llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s +++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s @@ -32,12 +32,12 @@ lwpc $6,foo # Test R_MIPS_PC21_S2 relocation. -# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2))[22:0] +# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2) + 0x04)[22:0] R_MIPS_PC21_S2: bnezc $5,foo # Test R_MIPS_PC26_S2 relocation. -# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2))[27:0] +# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2) + 0x04)[27:0] R_MIPS_PC26_S2: balc foo Index: llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s =================================================================== --- llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s +++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s @@ -27,12 +27,12 @@ lwpc $6,foo # Test R_MIPS_PC21_S2 relocation. -# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2))[22:0] +# rtdyld-check: decode_operand(R_MIPS_PC21_S2, 1)[22:0] = (foo - next_pc(R_MIPS_PC21_S2) + 0x04)[22:0] R_MIPS_PC21_S2: bnezc $5,foo # Test R_MIPS_PC26_S2 relocation. -# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2))[27:0] +# rtdyld-check: decode_operand(R_MIPS_PC26_S2, 0)[27:0] = (foo - next_pc(R_MIPS_PC26_S2) + 0x04)[27:0] R_MIPS_PC26_S2: balc foo Index: llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt +++ llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt @@ -7,8 +7,8 @@ 0xe9 0xff 0x62 0x3c # CHECK: aui $3, $2, -23 0xff 0xff 0x7e 0xec # CHECK: auipc $3, -1 0x9b 0x14 0x11 0x04 # CHECK: bal 21104 -0xb8 0x96 0x37 0xe8 # CHECK: balc 14572256 -0xb8 0x96 0x37 0xc8 # CHECK: bc 14572256 +0xb8 0x96 0x37 0xe8 # CHECK: balc 14572260 +0xb8 0x96 0x37 0xc8 # CHECK: bc 14572260 0x01 0x00 0x20 0x45 # CHECK: bc1eqz $f0, 8 0x01 0x00 0x3f 0x45 # CHECK: bc1eqz $f31, 8 0x01 0x00 0xa0 0x45 # CHECK: bc1nez $f0, 8 @@ -17,31 +17,44 @@ 0x02 0x00 0x3f 0x49 # CHECK: bc2eqz $31, 12 0x02 0x00 0xa0 0x49 # CHECK: bc2nez $0, 12 0x02 0x00 0xbf 0x49 # CHECK: bc2nez $31, 12 -0x40 0x00 0xa6 0x20 # CHECK: beqc $5, $6, 256 -0x4d 0x01 0x02 0x20 # CHECK: beqzalc $2, 1332 -0x40 0x00 0xa6 0x60 # CHECK: bnec $5, $6, 256 -0x4d 0x01 0x02 0x60 # CHECK: bnezalc $2, 1332 -0x90 0x46 0xa0 0xd8 # CHECK: beqzc $5, 72256 -0x40 0x00 0x43 0x58 # CHECK: bgec $2, $3, 256 -0x40 0x00 0x43 0x18 # CHECK: bgeuc $2, $3, 256 -0x4d 0x01 0x42 0x18 # CHECK: bgezalc $2, 1332 -0x90 0x46 0xa0 0xf8 # CHECK: bnezc $5, 72256 -0x40 0x00 0xa5 0x5c # CHECK: bltzc $5, 256 -0x40 0x00 0xa5 0x58 # CHECK: bgezc $5, 256 -0x4d 0x01 0x02 0x1c # CHECK: bgtzalc $2, 1332 -0x40 0x00 0x05 0x58 # CHECK: blezc $5, 256 -0x4d 0x01 0x42 0x1c # CHECK: bltzalc $2, 1332 -0x40 0x00 0x05 0x5c # CHECK: bgtzc $5, 256 +0x40 0x00 0xa6 0x20 # CHECK: beqc $5, $6, 260 +0x4d 0x01 0x02 0x20 # CHECK: beqzalc $2, 1336 +0x40 0x00 0xa6 0x60 # CHECK: bnec $5, $6, 260 +0xfa 0xff 0x43 0x60 # CHECK: bnec $2, $3, -20 +0x4d 0x01 0x02 0x60 # CHECK: bnezalc $2, 1336 +0x90 0x46 0xa0 0xd8 # CHECK: beqzc $5, 72260 +0x40 0x00 0x43 0x58 # CHECK: bgec $2, $3, 260 +0xfa 0xff 0x43 0x58 # CHECK: bgec $2, $3, -20 +0x40 0x00 0x43 0x18 # CHECK: bgeuc $2, $3, 260 +0xfa 0xff 0x43 0x18 # CHECK: bgeuc $2, $3, -20 +0x4d 0x01 0x42 0x18 # CHECK: bgezalc $2, 1336 +0xfa 0xff 0x42 0x18 # CHECK: bgezalc $2, -20 +0x90 0x46 0xa0 0xf8 # CHECK: bnezc $5, 72260 +0x40 0x00 0xa5 0x5c # CHECK: bltzc $5, 260 +0xfa 0xff 0xa5 0x5c # CHECK: bltzc $5, -20 +0x40 0x00 0xa5 0x58 # CHECK: bgezc $5, 260 +0xfa 0xff 0xa5 0x58 # CHECK: bgezc $5, -20 +0x4d 0x01 0x02 0x1c # CHECK: bgtzalc $2, 1336 +0xfa 0xff 0x02 0x1c # CHECK: bgtzalc $2, -20 +0x40 0x00 0x05 0x58 # CHECK: blezc $5, 260 +0xfa 0xff 0x05 0x58 # CHECK: blezc $5, -20 +0x4d 0x01 0x42 0x1c # CHECK: bltzalc $2, 1336 +0xfa 0xff 0x42 0x1c # CHECK: bltzalc $2, -20 +0x40 0x00 0x05 0x5c # CHECK: bgtzc $5, 260 +0xfa 0xff 0x05 0x5c # CHECK: bgtzc $5, -20 0x20 0x20 0x02 0x7c # CHECK: bitswap $4, $2 -0x4d 0x01 0x02 0x18 # CHECK: blezalc $2, 1332 -0x40 0x00 0xa6 0x5c # CHECK: bltc $5, $6, 256 -0x40 0x00 0xa6 0x1c # CHECK: bltuc $5, $6, 256 -0x01 0x00 0x00 0x60 # CHECK: bnvc $zero, $zero, 4 -0x01 0x00 0x40 0x60 # CHECK: bnvc $2, $zero, 4 -0x01 0x00 0x82 0x60 # CHECK: bnvc $4, $2, 4 -0x01 0x00 0x00 0x20 # CHECK: bovc $zero, $zero, 4 -0x01 0x00 0x40 0x20 # CHECK: bovc $2, $zero, 4 -0x01 0x00 0x82 0x20 # CHECK: bovc $4, $2, 4 +0x4d 0x01 0x02 0x18 # CHECK: blezalc $2, 1336 +0xfa 0xff 0x02 0x18 # CHECK: blezalc $2, -20 +0x40 0x00 0xa6 0x5c # CHECK: bltc $5, $6, 260 +0xfa 0xff 0xa6 0x5c # CHECK: bltc $5, $6, -20 +0x40 0x00 0xa6 0x1c # CHECK: bltuc $5, $6, 260 +0xfa 0xff 0xa6 0x1c # CHECK: bltuc $5, $6, -20 +0x01 0x00 0x00 0x60 # CHECK: bnvc $zero, $zero, 8 +0x01 0x00 0x40 0x60 # CHECK: bnvc $2, $zero, 8 +0x01 0x00 0x82 0x60 # CHECK: bnvc $4, $2, 8 +0x01 0x00 0x00 0x20 # CHECK: bovc $zero, $zero, 8 +0x01 0x00 0x40 0x20 # CHECK: bovc $2, $zero, 8 +0x01 0x00 0x82 0x20 # CHECK: bovc $4, $2, 8 0x80 0x18 0x84 0x46 # CHECK: cmp.af.s $f2, $f3, $f4 0x80 0x18 0xa4 0x46 # CHECK: cmp.af.d $f2, $f3, $f4 0x81 0x18 0x84 0x46 # CHECK: cmp.un.s $f2, $f3, $f4 Index: llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt +++ llvm/trunk/test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt @@ -35,22 +35,28 @@ 0x02 0xdc 0x00 0x31 # CHECK: tgeu $22, $gp 0x03 0x80 0xe8 0x50 # CHECK: clz $sp, $gp 0x04 0x11 0x14 0x9b # CHECK: bal 21104 -# FIXME: The encode/decode functions are not inverses of each other. -0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1332 -# FIXME: The encode/decode functions are not inverses of each other. -0x18 0x42 0x01 0x4d # CHECK: bgezalc $2, 1332 -0x18 0x43 0x00 0x40 # CHECK: bgeuc $2, $3, 256 -# FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1332 -# FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x42 0x01 0x4d # CHECK: bltzalc $2, 1332 -0x1c 0xa6 0x00 0x40 # CHECK: bltuc $5, $6, 256 -0x20 0x00 0x00 0x01 # CHECK: bovc $zero, $zero, 4 -# FIXME: The encode/decode functions are not inverses of each other. -0x20 0x02 0x01 0x4d # CHECK: beqzalc $2, 1332 -0x20 0x40 0x00 0x01 # CHECK: bovc $2, $zero, 4 -0x20 0x82 0x00 0x01 # CHECK: bovc $4, $2, 4 -0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 256 +# The encode/decode functions are not inverses of each other. +0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1336 +0x18 0x02 0xff 0xfa # CHECk: blezalc $2, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x18 0x42 0x01 0x4d # CHECK: bgezalc $2, 1336 +0x18 0x42 0xff 0xfa # CHECK: bgezalc $2, -20 +0x18 0x43 0x00 0x40 # CHECK: bgeuc $2, $3, 260 +0x18 0x43 0xff 0xfa # CHECK: bgeuc $2, $3, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1336 +0x1c 0x02 0xff 0xfa # CHECK: bgtzalc $2, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x1c 0x42 0x01 0x4d # CHECK: bltzalc $2, 1336 +0x1c 0x42 0xff 0xfa # CHECK: bltzalc $2, -20 +0x1c 0xa6 0x00 0x40 # CHECK: bltuc $5, $6, 260 +0x1c 0xa6 0xff 0xfa # CHECK: bltuc $5, $6, -20 +0x20 0x00 0x00 0x01 # CHECK: bovc $zero, $zero, 8 +# The encode/decode functions are not inverses of each other in the immediate case. +0x20 0x02 0x01 0x4d # CHECK: beqzalc $2, 1336 +0x20 0x40 0x00 0x01 # CHECK: bovc $2, $zero, 8 +0x20 0x82 0x00 0x01 # CHECK: bovc $4, $2, 8 +0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 260 0x25 0x29 0x00 0x0a # CHECK: addiu $9, $9, 10 0x30 0x42 0x00 0x04 # CHECK: andi $2, $2, 4 0x34 0x42 0x00 0x04 # CHECK: ori $2, $2, 4 @@ -145,32 +151,41 @@ 0x49 0xbf 0x00 0x02 # CHECK: bc2nez $31, 12 0x49 0xc8 0x0d 0x43 # CHECK: ldc2 $8, -701($1) 0x49 0xf4 0x92 0x75 # CHECK: sdc2 $20, 629($18) -0x58 0x05 0x00 0x40 # CHECK: blezc $5, 256 -0x58 0x43 0x00 0x40 # CHECK: bgec $2, $3, 256 -0x58 0xa5 0x00 0x40 # CHECK: bgezc $5, 256 -0x5c 0x05 0x00 0x40 # CHECK: bgtzc $5, 256 -0x5c 0xa5 0x00 0x40 # CHECK: bltzc $5, 256 -0x5c 0xa6 0x00 0x40 # CHECK: bltc $5, $6, 256 -0x60 0x00 0x00 0x01 # CHECK: bnvc $zero, $zero, 4 -# FIXME: The encode/decode functions are not inverses of each other. -0x60 0x02 0x01 0x4d # CHECK: bnezalc $2, 1332 -0x60 0x40 0x00 0x01 # CHECK: bnvc $2, $zero, 4 -0x60 0x82 0x00 0x01 # CHECK: bnvc $4, $2, 4 -0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 256 +0x58 0x05 0x00 0x40 # CHECK: blezc $5, 260 +0x58 0x05 0xff 0xfa # CHECk: blezc $5, -20 +0x58 0x43 0x00 0x40 # CHECK: bgec $2, $3, 260 +0x58 0x43 0xff 0xfa # CHECK: bgec $2, $3, -20 +0x58 0xa5 0x00 0x40 # CHECK: bgezc $5, 260 +0x58 0xa5 0xff 0xfa # CHECK: bgezc $5, -20 +0x5c 0x05 0x00 0x40 # CHECK: bgtzc $5, 260 +0x5c 0x05 0xff 0xfa # CHECk: bgtzc $5, -20 +0x5c 0xa5 0x00 0x40 # CHECK: bltzc $5, 260 +0x5c 0xa5 0xff 0xfa # CHECK: bltzc $5, -20 +0x5c 0xa6 0x00 0x40 # CHECK: bltc $5, $6, 260 +0x5c 0xa6 0xff 0xfa # CHECK: bltc $5, $6, -20 +0x60 0x00 0x00 0x01 # CHECK: bnvc $zero, $zero, 8 +# The encode/decode functions are not inverses of each other in the immediate case. +0x60 0x02 0x01 0x4d # CHECK: bnezalc $2, 1336 +0x60 0x40 0x00 0x01 # CHECK: bnvc $2, $zero, 8 +0x60 0x82 0x00 0x01 # CHECK: bnvc $4, $2, 8 +0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 260 +0x60 0x43 0xff 0xfa # CHECK: bnec $2, $3, -20 0x7c 0x02 0x20 0x20 # CHECK: bitswap $4, $2 0x7c 0x43 0x22 0xa0 # CHECK: align $4, $2, $3, 2 0x7c 0xa1 0x04 0x25 # CHECK: cache 1, 8($5) 0x7c 0xa1 0x04 0x35 # CHECK: pref 1, 8($5) 0x7e 0x42 0xb3 0xb6 # CHECK: ll $2, -153($18) 0x7e 0x6f 0xec 0x26 # CHECK: sc $15, -40($19) -0xc8 0x37 0x96 0xb8 # CHECK: bc 14572256 +0xc8 0x37 0x96 0xb8 # CHECK: bc 14572260 0xd8 0x05 0x01 0x00 # CHECK: jic $5, 256 -0xd8 0xa0 0x46 0x90 # CHECK: beqzc $5, 72256 -0xe8 0x37 0x96 0xb8 # CHECK: balc 14572256 +0xd8 0xa0 0x46 0x90 # CHECK: beqzc $5, 72260 +0xd8 0x5f 0xff 0xfa # CHECK: beqzc $2, -20 +0xe8 0x37 0x96 0xb8 # CHECK: balc 14572260 0xec 0x48 0x00 0x43 # CHECK: lwpc $2, 268 0xec 0x50 0x00 0x43 # CHECK: lwupc $2, 268 0xec 0x7e 0xff 0xff # CHECK: auipc $3, -1 0xec 0x7f 0x00 0x38 # CHECK: aluipc $3, 56 0xec 0x80 0x00 0x19 # CHECK: addiupc $4, 100 0xf8 0x05 0x01 0x00 # CHECK: jialc $5, 256 -0xf8 0xa0 0x46 0x90 # CHECK: bnezc $5, 72256 +0xf8 0xa0 0x46 0x90 # CHECK: bnezc $5, 72260 +0xf8 0x5f 0xff 0xfa # CHECK: bnezc $2, -20 Index: llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt +++ llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt @@ -7,8 +7,8 @@ 0xe9 0xff 0x62 0x3c # CHECK: aui $3, $2, -23 0xff 0xff 0x7e 0xec # CHECK: auipc $3, -1 0x9b 0x14 0x11 0x04 # CHECK: bal 21104 -0xb8 0x96 0x37 0xe8 # CHECK: balc 14572256 -0xb8 0x96 0x37 0xc8 # CHECK: bc 14572256 +0xb8 0x96 0x37 0xe8 # CHECK: balc 14572260 +0xb8 0x96 0x37 0xc8 # CHECK: bc 14572260 0x01 0x00 0x20 0x45 # CHECK: bc1eqz $f0, 8 0x01 0x00 0x3f 0x45 # CHECK: bc1eqz $f31, 8 0x01 0x00 0xa0 0x45 # CHECK: bc1nez $f0, 8 @@ -17,31 +17,46 @@ 0x02 0x00 0x3f 0x49 # CHECK: bc2eqz $31, 12 0x02 0x00 0xa0 0x49 # CHECK: bc2nez $0, 12 0x02 0x00 0xbf 0x49 # CHECK: bc2nez $31, 12 -0x40 0x00 0xa6 0x20 # CHECK: beqc $5, $6, 256 -0x4d 0x01 0x02 0x20 # CHECK: beqzalc $2, 1332 -0x90 0x46 0xa0 0xd8 # CHECK: beqzc $5, 72256 -0x40 0x00 0x43 0x58 # CHECK: bgec $2, $3, 256 -0x40 0x00 0x43 0x18 # CHECK: bgeuc $2, $3, 256 -0x4d 0x01 0x42 0x18 # CHECK: bgezalc $2, 1332 -0x40 0x00 0xa5 0x58 # CHECK: bgezc $5, 256 -0x4d 0x01 0x02 0x1c # CHECK: bgtzalc $2, 1332 -0x40 0x00 0x05 0x5c # CHECK: bgtzc $5, 256 +0x40 0x00 0xa6 0x20 # CHECK: beqc $5, $6, 260 +0x4d 0x01 0x02 0x20 # CHECK: beqzalc $2, 1336 +0x90 0x46 0xa0 0xd8 # CHECK: beqzc $5, 72260 +0xfa 0xff 0x5f 0xd8 # CHECK: beqzc $2, -20 +0x40 0x00 0x43 0x58 # CHECK: bgec $2, $3, 260 +0xfa 0xff 0x43 0x58 # CHECK: bgec $2, $3, -20 +0x40 0x00 0x43 0x18 # CHECK: bgeuc $2, $3, 260 +0xfa 0xff 0x43 0x18 # CHECK: bgeuc $2, $3, -20 +0x4d 0x01 0x42 0x18 # CHECK: bgezalc $2, 1336 +0xfa 0xff 0x42 0x18 # CHECK: bgezalc $2, -20 +0x40 0x00 0xa5 0x58 # CHECK: bgezc $5, 260 +0xfa 0xff 0xa5 0x58 # CHECK: bgezc $5, -20 +0x4d 0x01 0x02 0x1c # CHECK: bgtzalc $2, 1336 +0xfa 0xff 0x02 0x1c # CHECK: bgtzalc $2, -20 +0x40 0x00 0x05 0x5c # CHECK: bgtzc $5, 260 +0xfa 0xff 0x05 0x5c # CHECK: bgtzc $5, -20 0x20 0x20 0x02 0x7c # CHECK: bitswap $4, $2 -0x4d 0x01 0x02 0x18 # CHECK: blezalc $2, 1332 -0x40 0x00 0x05 0x58 # CHECK: blezc $5, 256 -0x40 0x00 0xa6 0x5c # CHECK: bltc $5, $6, 256 -0x40 0x00 0xa6 0x1c # CHECK: bltuc $5, $6, 256 -0x4d 0x01 0x42 0x1c # CHECK: bltzalc $2, 1332 -0x40 0x00 0xa5 0x5c # CHECK: bltzc $5, 256 -0x40 0x00 0xa6 0x60 # CHECK: bnec $5, $6, 256 -0x4d 0x01 0x02 0x60 # CHECK: bnezalc $2, 1332 -0x90 0x46 0xa0 0xf8 # CHECK: bnezc $5, 72256 -0x01 0x00 0x40 0x60 # CHECK: bnvc $2, $zero, 4 -0x01 0x00 0x82 0x60 # CHECK: bnvc $4, $2, 4 -0x01 0x00 0x00 0x60 # CHECK: bnvc $zero, $zero, 4 -0x01 0x00 0x40 0x20 # CHECK: bovc $2, $zero, 4 -0x01 0x00 0x82 0x20 # CHECK: bovc $4, $2, 4 -0x01 0x00 0x00 0x20 # CHECK: bovc $zero, $zero, 4 +0x4d 0x01 0x02 0x18 # CHECK: blezalc $2, 1336 +0xfa 0xff 0x02 0x18 # CHECK: blezalc $2, -20 +0x40 0x00 0x05 0x58 # CHECK: blezc $5, 260 +0xfa 0xff 0x05 0x58 # CHECK: blezc $5, -20 +0x40 0x00 0xa6 0x5c # CHECK: bltc $5, $6, 260 +0xfa 0xff 0xa6 0x5c # CHECK: bltc $5, $6, -20 +0x40 0x00 0xa6 0x1c # CHECK: bltuc $5, $6, 260 +0xfa 0xff 0xa6 0x1c # CHECK: bltuc $5, $6, -20 +0x4d 0x01 0x42 0x1c # CHECK: bltzalc $2, 1336 +0xfa 0xff 0x42 0x1c # CHECK: bltzalc $2, -20 +0x40 0x00 0xa5 0x5c # CHECK: bltzc $5, 260 +0xfa 0xff 0xa5 0x5c # CHECK: bltzc $5, -20 +0x40 0x00 0xa6 0x60 # CHECK: bnec $5, $6, 260 +0xfa 0xff 0x43 0x60 # CHECK: bnec $2, $3, -20 +0x4d 0x01 0x02 0x60 # CHECK: bnezalc $2, 1336 +0x90 0x46 0xa0 0xf8 # CHECK: bnezc $5, 72260 +0xfa 0xff 0x5f 0xf8 # CHECK: bnezc $2, -20 +0x01 0x00 0x40 0x60 # CHECK: bnvc $2, $zero, 8 +0x01 0x00 0x82 0x60 # CHECK: bnvc $4, $2, 8 +0x01 0x00 0x00 0x60 # CHECK: bnvc $zero, $zero, 8 +0x01 0x00 0x40 0x20 # CHECK: bovc $2, $zero, 8 +0x01 0x00 0x82 0x20 # CHECK: bovc $4, $2, 8 +0x01 0x00 0x00 0x20 # CHECK: bovc $zero, $zero, 8 0x25 0x04 0xa1 0x7c # CHECK: cache 1, 8($5) 0x9b 0x20 0x20 0x46 # CHECK: class.d $f2, $f4 0x9b 0x20 0x00 0x46 # CHECK: class.s $f2, $f4 Index: llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt +++ llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt @@ -52,22 +52,28 @@ 0x04 0x11 0x14 0x9b # CHECK: bal 21104 0x04 0x66 0x56 0x78 # CHECK: dahi $3, 22136 0x04 0x7e 0xab 0xcd # CHECK: dati $3, -21555 -# FIXME: The encode/decode functions are not inverses of each other. -0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1332 -# FIXME: The encode/decode functions are not inverses of each other. -0x18 0x42 0x01 0x4d # CHECK: bgezalc $2, 1332 -0x18 0x43 0x00 0x40 # CHECK: bgeuc $2, $3, 256 -# FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1332 -# FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x42 0x01 0x4d # CHECK: bltzalc $2, 1332 -0x1c 0xa6 0x00 0x40 # CHECK: bltuc $5, $6, 256 -0x20 0x00 0x00 0x01 # CHECK: bovc $zero, $zero, 4 -# FIXME: The encode/decode functions are not inverses of each other. -0x20 0x02 0x01 0x4d # CHECK: beqzalc $2, 1332 -0x20 0x40 0x00 0x01 # CHECK: bovc $2, $zero, 4 -0x20 0x82 0x00 0x01 # CHECK: bovc $4, $2, 4 -0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 256 +# The encode/decode functions are not inverses of each other in the immediate case. +0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1336 +0x18 0x02 0xff 0xfa # CHECk: blezalc $2, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x18 0x42 0x01 0x4d # CHECK: bgezalc $2, 1336 +0x18 0x42 0xff 0xfa # CHECK: bgezalc $2, -20 +0x18 0x43 0x00 0x40 # CHECK: bgeuc $2, $3, 260 +0x18 0x43 0xff 0xfa # CHECK: bgeuc $2, $3, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1336 +0x1c 0x02 0xff 0xfa # CHECK: bgtzalc $2, -20 +# The encode/decode functions are not inverses of each other in the immediate case. +0x1c 0x42 0x01 0x4d # CHECK: bltzalc $2, 1336 +0x1c 0x42 0xff 0xfa # CHECK: bltzalc $2, -20 +0x1c 0xa6 0x00 0x40 # CHECK: bltuc $5, $6, 260 +0x1c 0xa6 0xff 0xfa # CHECK: bltuc $5, $6, -20 +0x20 0x00 0x00 0x01 # CHECK: bovc $zero, $zero, 8 +# The encode/decode functions are not inverses of each other in the immediate case. +0x20 0x02 0x01 0x4d # CHECK: beqzalc $2, 1336 +0x20 0x40 0x00 0x01 # CHECK: bovc $2, $zero, 8 +0x20 0x82 0x00 0x01 # CHECK: bovc $4, $2, 8 +0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 260 0x25 0x29 0x00 0x0a # CHECK: addiu $9, $9, 10 0x30 0x42 0x00 0x04 # CHECK: andi $2, $2, 4 0x34 0x42 0x00 0x04 # CHECK: ori $2, $2, 4 @@ -164,18 +170,25 @@ 0x49 0xbf 0x00 0x02 # CHECK: bc2nez $31, 12 0x49 0xc8 0x0d 0x43 # CHECK: ldc2 $8, -701($1) 0x49 0xf4 0x92 0x75 # CHECK: sdc2 $20, 629($18) -0x58 0x05 0x00 0x40 # CHECK: blezc $5, 256 -0x58 0x43 0x00 0x40 # CHECK: bgec $2, $3, 256 -0x58 0xa5 0x00 0x40 # CHECK: bgezc $5, 256 -0x5c 0x05 0x00 0x40 # CHECK: bgtzc $5, 256 -0x5c 0xa5 0x00 0x40 # CHECK: bltzc $5, 256 -0x5c 0xa6 0x00 0x40 # CHECK: bltc $5, $6, 256 -0x60 0x00 0x00 0x01 # CHECK: bnvc $zero, $zero, 4 -# FIXME: The encode/decode functions are not inverses of each other. -0x60 0x02 0x01 0x4d # CHECK: bnezalc $2, 1332 -0x60 0x40 0x00 0x01 # CHECK: bnvc $2, $zero, 4 -0x60 0x82 0x00 0x01 # CHECK: bnvc $4, $2, 4 -0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 256 +0x58 0x05 0x00 0x40 # CHECK: blezc $5, 260 +0x58 0x05 0xff 0xfa # CHECk: blezc $5, -20 +0x58 0x43 0x00 0x40 # CHECK: bgec $2, $3, 260 +0x58 0x43 0xff 0xfa # CHECK: bgec $2, $3, -20 +0x58 0xa5 0x00 0x40 # CHECK: bgezc $5, 260 +0x58 0xa5 0xff 0xfa # CHECK: bgezc $5, -20 +0x5c 0x05 0x00 0x40 # CHECK: bgtzc $5, 260 +0x5c 0x05 0xff 0xfa # CHECk: bgtzc $5, -20 +0x5c 0xa5 0x00 0x40 # CHECK: bltzc $5, 260 +0x5c 0xa5 0xff 0xfa # CHECK: bltzc $5, -20 +0x5c 0xa6 0x00 0x40 # CHECK: bltc $5, $6, 260 +0x5c 0xa6 0xff 0xfa # CHECK: bltc $5, $6, -20 +0x60 0x00 0x00 0x01 # CHECK: bnvc $zero, $zero, 8 +# The encode/decode functions are not inverses of each other in the immediate case. +0x60 0x02 0x01 0x4d # CHECK: bnezalc $2, 1336 +0x60 0x40 0x00 0x01 # CHECK: bnvc $2, $zero, 8 +0x60 0x82 0x00 0x01 # CHECK: bnvc $4, $2, 8 +0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 260 +0x60 0x43 0xff 0xfa # CHECK: bnec $2, $3, -20 0x74 0x62 0x12 0x34 # CHECK: daui $3, $2, 4660 0x7c 0x02 0x20 0x20 # CHECK: bitswap $4, $2 0x7c 0x02 0x20 0x24 # CHECK: dbitswap $4, $2 @@ -187,10 +200,11 @@ 0x7e 0x6f 0xec 0x26 # CHECK: sc $15, -40($19) 0x7f 0xaf 0xe6 0xa7 # CHECK: scd $15, -51($sp) 0x7f 0xe0 0x38 0x37 # CHECK: lld $zero, 112($ra) -0xc8 0x37 0x96 0xb8 # CHECK: bc 14572256 +0xc8 0x37 0x96 0xb8 # CHECK: bc 14572260 0xd8 0x05 0x01 0x00 # CHECK: jic $5, 256 -0xd8 0xa0 0x46 0x90 # CHECK: beqzc $5, 72256 -0xe8 0x37 0x96 0xb8 # CHECK: balc 14572256 +0xd8 0xa0 0x46 0x90 # CHECK: beqzc $5, 72260 +0xd8 0x5f 0xff 0xfa # CHECK: beqzc $2, -20 +0xe8 0x37 0x96 0xb8 # CHECK: balc 14572260 0xec 0x48 0x00 0x43 # CHECK: lwpc $2, 268 0xec 0x50 0x00 0x43 # CHECK: lwupc $2, 268 0xec 0x58 0x3c 0x48 # CHECK: ldpc $2, 123456 @@ -198,4 +212,5 @@ 0xec 0x7f 0x00 0x38 # CHECK: aluipc $3, 56 0xec 0x80 0x00 0x19 # CHECK: addiupc $4, 100 0xf8 0x05 0x01 0x00 # CHECK: jialc $5, 256 -0xf8 0xa0 0x46 0x90 # CHECK: bnezc $5, 72256 +0xf8 0xa0 0x46 0x90 # CHECK: bnezc $5, 72260 +0xf8 0x5f 0xff 0xfa # CHECK: bnezc $2, -20 Index: llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-xfail-mips64r6.txt =================================================================== --- llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-xfail-mips64r6.txt +++ llvm/trunk/test/MC/Disassembler/Mips/mips64r6/valid-xfail-mips64r6.txt @@ -3,16 +3,16 @@ # # RUN: llvm-mc %s -disassemble -triple=mips-unknown-linux -mcpu=mips64r6 | FileCheck %s # XFAIL: * -0x20 0x40 0x00 0x01 # CHECK: bovc $0, $2, 4 -0x20 0x82 0x00 0x01 # CHECK: bovc $2, $4, 4 -0x60 0x40 0x00 0x01 # CHECK: bnvc $0, $2, 4 -0x60 0x82 0x00 0x01 # CHECK: bnvc $2, $4, 4 -0x20 0xc0 0x00 0x40 # CHECK: beqc $6, $zero, 256 -0x20 0xa0 0x00 0x40 # CHECK: beqc $5, $zero, 256 -0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 256 -0x60 0xc0 0x00 0x40 # CHECK: bnec $6, $zero, 256 -0x60 0xa0 0x00 0x40 # CHECK: bnec $5, $zero, 256 -0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 256 +0x20 0x40 0x00 0x01 # CHECK: bovc $0, $2, 8 +0x20 0x82 0x00 0x01 # CHECK: bovc $2, $4, 8 +0x60 0x40 0x00 0x01 # CHECK: bnvc $0, $2, 8 +0x60 0x82 0x00 0x01 # CHECK: bnvc $2, $4, 8 +0x20 0xc0 0x00 0x40 # CHECK: beqc $6, $zero, 260 +0x20 0xa0 0x00 0x40 # CHECK: beqc $5, $zero, 260 +0x20 0xa6 0x00 0x40 # CHECK: beqc $5, $6, 260 +0x60 0xc0 0x00 0x40 # CHECK: bnec $6, $zero, 260 +0x60 0xa0 0x00 0x40 # CHECK: bnec $5, $zero, 260 +0x60 0xa6 0x00 0x40 # CHECK: bnec $5, $6, 260 0x64 0x58 0x46 0x9f # CHECK: daddiu $24, $2, 18079 0x66 0x73 0x69 0x3f # CHECK: daddiu $19, $19, 26943 0x65 0x6f 0xec 0x5f # CHECK: daddiu $15, $11, -5025