Index: lib/Target/Mips/Disassembler/MipsDisassembler.cpp =================================================================== --- lib/Target/Mips/Disassembler/MipsDisassembler.cpp +++ lib/Target/Mips/Disassembler/MipsDisassembler.cpp @@ -563,7 +563,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) { @@ -602,7 +602,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) { @@ -642,7 +642,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) @@ -687,7 +687,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; @@ -729,7 +729,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; @@ -778,7 +778,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) @@ -1822,7 +1822,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; @@ -1832,7 +1832,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: test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt =================================================================== --- test/MC/Disassembler/Mips/mips32r6/valid-mips32r6-el.txt +++ 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: test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt =================================================================== --- test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt +++ test/MC/Disassembler/Mips/mips32r6/valid-mips32r6.txt @@ -34,21 +34,27 @@ 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 +0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1336 +0x18 0x02 0xff 0xfa # CHECk: blezalc $2, -20 # 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 +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 # FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1332 +0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1336 +0x1c 0x02 0xff 0xfa # CHECK: bgtzalc $2, -20 # 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 +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 # 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 +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 @@ -143,32 +149,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 +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 # 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 +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: test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt =================================================================== --- test/MC/Disassembler/Mips/mips64r6/valid-mips64r6-el.txt +++ 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: test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt =================================================================== --- test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt +++ test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt @@ -51,21 +51,27 @@ 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 +0x18 0x02 0x01 0x4d # CHECK: blezalc $2, 1336 +0x18 0x02 0xff 0xfa # CHECk: blezalc $2, -20 # 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 +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 # FIXME: The encode/decode functions are not inverses of each other. -0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1332 +0x1c 0x02 0x01 0x4d # CHECK: bgtzalc $2, 1336 +0x1c 0x02 0xff 0xfa # CHECK: bgtzalc $2, -20 # 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 +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 # 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 +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 @@ -162,18 +168,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 +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 # 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 +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 @@ -185,9 +198,10 @@ 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 +0xd8 0xa0 0x46 0x90 # CHECK: beqzc $5, 72260 +0xd8 0x5f 0xff 0xfa # CHECK: beqzc $2, -20 0xe8 0x37 0x96 0xb8 # CHECK: balc 14572256 0xec 0x48 0x00 0x43 # CHECK: lwpc $2, 268 0xec 0x50 0x00 0x43 # CHECK: lwupc $2, 268 @@ -197,3 +211,4 @@ 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 0x5f 0xff 0xfa # CHECK: bnezc $2, -20 Index: test/MC/Disassembler/Mips/mips64r6/valid-xfail-mips64r6.txt =================================================================== --- test/MC/Disassembler/Mips/mips64r6/valid-xfail-mips64r6.txt +++ 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