mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[mips] Make "b" (unconditional branch) a pseudo. "b" is an assembly idiom, which is
equivalent to "beq $zero, $zero, offset". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -230,8 +230,11 @@ bool MipsInstPrinter::printAlias(const char *Str, const MCInst &MI,
|
||||
bool MipsInstPrinter::printAlias(const MCInst &MI, raw_ostream &OS) {
|
||||
switch (MI.getOpcode()) {
|
||||
case Mips::BEQ:
|
||||
// beq $zero, $zero, $L2 => b $L2
|
||||
// beq $r0, $zero, $L2 => beqz $r0, $L2
|
||||
return isReg<Mips::ZERO>(MI, 1) && printAlias("beqz", MI, 0, 2, OS);
|
||||
return isReg<Mips::ZERO>(MI, 0) && isReg<Mips::ZERO>(MI, 1) &&
|
||||
printAlias("b", MI, 2, OS) ||
|
||||
isReg<Mips::ZERO>(MI, 1) && printAlias("beqz", MI, 0, 2, OS);
|
||||
case Mips::BEQ64:
|
||||
// beq $r0, $zero, $L2 => beqz $r0, $L2
|
||||
return isReg<Mips::ZERO_64>(MI, 1) && printAlias("beqz", MI, 0, 2, OS);
|
||||
|
Reference in New Issue
Block a user