diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -4615,8 +4615,9 @@ def TLBSYNC : XForm_0<31, 566, (outs), (ins), "tlbsync", IIC_SprTLBSYNC, []>; -def TLBIEL : XForm_16b<31, 274, (outs), (ins gprc:$RB), - "tlbiel $RB", IIC_SprTLBIEL, []>; +def TLBIEL : XForm_tlbie<274, (outs), + (ins gprc:$RS, gprc:$RB, i32imm:$RIC, i1imm:$PRS, i1imm:$R), + "tlbiel $RB, $RS, $RIC, $PRS, $R", IIC_SprTLBIEL, []>; def TLBLD : XForm_16b<31, 978, (outs), (ins gprc:$RB), "tlbld $RB", IIC_LdStLoad, []>, Requires<[IsPPC6xx]>; @@ -4986,6 +4987,7 @@ } def : InstAlias<"tlbie $RB, $RS", (TLBIE gprc:$RS, gprc:$RB, 0, 0, 0)>; +def : InstAlias<"tlbiel $RB", (TLBIEL R0, gprc:$RB, 0, 0, 0)>; def : InstAlias<"tlbrehi $RS, $A", (TLBRE2 gprc:$RS, gprc:$A, 0)>, Requires<[IsPPC4xx]>; diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-bookIII.s b/llvm/test/MC/PowerPC/ppc64-encoding-bookIII.s --- a/llvm/test/MC/PowerPC/ppc64-encoding-bookIII.s +++ b/llvm/test/MC/PowerPC/ppc64-encoding-bookIII.s @@ -158,9 +158,17 @@ # CHECK-LE: tlbsync # encoding: [0x6c,0x04,0x00,0x7c] tlbsync -# CHECK-BE: tlbiel 4 # encoding: [0x7c,0x00,0x22,0x24] -# CHECK-LE: tlbiel 4 # encoding: [0x24,0x22,0x00,0x7c] - tlbiel %r4 +# CHECK-BE: tlbiel 3 # encoding: [0x7c,0x00,0x1a,0x24] +# CHECK-LE: tlbiel 3 # encoding: [0x24,0x1a,0x00,0x7c] + tlbiel %r3, 0, 0, 0, 0 + +# CHECK-BE: tlbiel 3 # encoding: [0x7c,0x00,0x1a,0x24] +# CHECK-LE: tlbiel 3 # encoding: [0x24,0x1a,0x00,0x7c] + tlbiel %r3 + +# CHECK-BE: tlbiel 3, 4, 3, 1, 1 # encoding: [0x7c,0x8f,0x1a,0x24] +# CHECK-LE: tlbiel 3, 4, 3, 1, 1 # encoding: [0x24,0x1a,0x8f,0x7c] + tlbiel %r3, %r4, 3, 1, 1 # Note that the one-operand version of "tlbie" is accepted by POWER6, but seems # to be invalid for later POWER versions.