[llvm-commits] [llvm] r167861 - in /llvm/trunk/lib/Target/PowerPC: PPCInstr64Bit.td PPCInstrFormats.td PPCInstrInfo.td
Chandler Carruth
chandlerc at google.com
Tue Nov 13 12:03:41 PST 2012
On Tue, Nov 13, 2012 at 11:15 AM, Ulrich Weigand
<ulrich.weigand at de.ibm.com> wrote:
> Author: uweigand
> Date: Tue Nov 13 13:15:52 2012
> New Revision: 167861
>
> URL: http://llvm.org/viewvc/llvm-project?rev=167861&view=rev
> Log:
> Fix instruction encoding for "bd(n)z" on PowerPC,
> by using a new instruction format BForm_1.
Test cases please.
>
> Modified:
> llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
> llvm/trunk/lib/Target/PowerPC/PPCInstrFormats.td
> llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td?rev=167861&r1=167860&r2=167861&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td Tue Nov 13 13:15:52 2012
> @@ -234,10 +234,10 @@
>
> let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in {
> let Defs = [CTR8], Uses = [CTR8] in {
> - def BDZ8 : IForm_ext<16, 18, 0, 0, (outs), (ins condbrtarget:$dst),
> - "bdz $dst", BrB, []>;
> - def BDNZ8 : IForm_ext<16, 16, 0, 0, (outs), (ins condbrtarget:$dst),
> - "bdnz $dst", BrB, []>;
> + def BDZ8 : BForm_1<16, 18, 0, 0, (outs), (ins condbrtarget:$dst),
> + "bdz $dst">;
> + def BDNZ8 : BForm_1<16, 16, 0, 0, (outs), (ins condbrtarget:$dst),
> + "bdnz $dst">;
> }
> }
>
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrFormats.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrFormats.td?rev=167861&r1=167860&r2=167861&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCInstrFormats.td (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCInstrFormats.td Tue Nov 13 13:15:52 2012
> @@ -94,12 +94,6 @@
> let Inst{31} = lk;
> }
>
> -class IForm_ext<bits<6> opcode, bits<5> bo, bit aa, bit lk, dag OOL, dag IOL,
> - string asmstr, InstrItinClass itin, list<dag> pattern>
> - : IForm<opcode, aa, lk, OOL, IOL, asmstr, itin, pattern> {
> - let LI{0-4} = bo;
> -}
> -
> // 1.7.2 B-Form
> class BForm<bits<6> opcode, bit aa, bit lk, dag OOL, dag IOL, string asmstr>
> : I<opcode, OOL, IOL, asmstr, BrB> {
> @@ -118,6 +112,13 @@
> let Inst{31} = lk;
> }
>
> +class BForm_1<bits<6> opcode, bits<5> bo, bit aa, bit lk, dag OOL, dag IOL,
> + string asmstr>
> + : BForm<opcode, aa, lk, OOL, IOL, asmstr> {
> + let BIBO{4-0} = bo;
> + let BIBO{6-5} = 0;
> + let CR = 0;
> +}
>
> // 1.7.4 D-Form
> class DForm_base<bits<6> opcode, dag OOL, dag IOL, string asmstr,
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=167861&r1=167860&r2=167861&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Tue Nov 13 13:15:52 2012
> @@ -446,10 +446,10 @@
> /*[(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)]*/>;
>
> let Defs = [CTR], Uses = [CTR] in {
> - def BDZ : IForm_ext<16, 18, 0, 0, (outs), (ins condbrtarget:$dst),
> - "bdz $dst", BrB, []>;
> - def BDNZ : IForm_ext<16, 16, 0, 0, (outs), (ins condbrtarget:$dst),
> - "bdnz $dst", BrB, []>;
> + def BDZ : BForm_1<16, 18, 0, 0, (outs), (ins condbrtarget:$dst),
> + "bdz $dst">;
> + def BDNZ : BForm_1<16, 16, 0, 0, (outs), (ins condbrtarget:$dst),
> + "bdnz $dst">;
> }
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list