diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-10-11 18:51:51 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-10-11 18:51:51 +0000 |
commit | 62547267f088a060d7c1084a40d740645efe86d1 (patch) | |
tree | f03c01d8071f079922fc7ccfa078f433d0e00a01 | |
parent | a2efc5ff6ecc7dfca66b51030510afd004732217 (diff) |
More binary encoding stuff, taking advantage of the new "by name" operand
matching in tblgen to do the predicate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116213 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMInstrFormats.td | 7 | ||||
-rw-r--r-- | lib/Target/ARM/ARMInstrInfo.td | 42 |
2 files changed, 24 insertions, 25 deletions
diff --git a/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index 263f151b2b..bde70e5c95 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/lib/Target/ARM/ARMInstrFormats.td @@ -241,6 +241,8 @@ class I<dag oops, dag iops, AddrMode am, SizeFlagVal sz, string opc, string asm, string cstr, list<dag> pattern> : InstARM<am, sz, im, f, GenericDomain, cstr, itin> { + bits<4> p; + let Inst{31-28} = p; let OutOperandList = oops; let InOperandList = !con(iops, (ins pred:$p)); let AsmString = !strconcat(opc, "${p}", asm); @@ -270,6 +272,11 @@ class sI<dag oops, dag iops, AddrMode am, SizeFlagVal sz, string opc, string asm, string cstr, list<dag> pattern> : InstARM<am, sz, im, f, GenericDomain, cstr, itin> { + bits<4> p; // Predicate operand + let Inst{31-28} = p; + // FIXME: The 's' operand needs to be handled, but the current generic + // get-value handlers don't know how to deal with it. + let OutOperandList = oops; let InOperandList = !con(iops, (ins pred:$p, cc_out:$s)); let AsmString = !strconcat(opc, "${p}${s}", asm); diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index 41c9cca90f..2fda464d64 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -478,20 +478,18 @@ multiclass AsI1_bin_irs<bits<4> opcod, string opc, let Inst{25} = 1; } } - def rr : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm, - iir, opc, "\t$dst, $a, $b", - [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]> { + def rr : AsI1<opcod, (outs GPR:$Rd), (ins GPR:$Rn, GPR:$Rm), DPFrm, + iir, opc, "\t$Rd, $Rn, $Rm", + [(set GPR:$Rd, (opnode GPR:$Rn, GPR:$Rm))]> { bits<4> Rd; bits<4> Rn; bits<4> Rm; - bits<4> Cond; let Inst{11-4} = 0b00000000; let Inst{25} = 0; let isCommutable = Commutable; let Inst{3-0} = Rm; let Inst{15-12} = Rd; let Inst{19-16} = Rn; - let Inst{31-28} = Cond; } def rs : AsI1<opcod, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm, iis, opc, "\t$dst, $a, $b", @@ -915,24 +913,20 @@ let isReturn = 1, isTerminator = 1, isBarrier = 1 in { def BX_RET : AI<(outs), (ins), BrMiscFrm, IIC_Br, "bx", "\tlr", [(ARMretflag)]>, Requires<[IsARM, HasV4T]> { - bits<4> Cond; let Inst{3-0} = 0b1110; let Inst{7-4} = 0b0001; let Inst{19-8} = 0b111111111111; let Inst{27-20} = 0b00010010; - let Inst{31-28} = Cond; } // ARMV4 only def MOVPCLR : AI<(outs), (ins), BrMiscFrm, IIC_Br, "mov", "\tpc, lr", [(ARMretflag)]>, Requires<[IsARM, NoV4T]> { - bits<4> Cond; let Inst{11-0} = 0b000000001110; let Inst{15-12} = 0b1111; let Inst{19-16} = 0b0000; let Inst{27-20} = 0b00011010; - let Inst{31-28} = Cond; } } @@ -942,27 +936,25 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in { def BRIND : AXI<(outs), (ins GPR:$dst), BrMiscFrm, IIC_Br, "bx\t$dst", [(brind GPR:$dst)]>, Requires<[IsARM, HasV4T]> { - bits<4> Rm; - + bits<4> dst; let Inst{7-4} = 0b0001; let Inst{19-8} = 0b111111111111; let Inst{27-20} = 0b00010010; let Inst{31-28} = 0b1110; - let Inst{3-0} = Rm; + let Inst{3-0} = dst; } // ARMV4 only def MOVPCRX : AXI<(outs), (ins GPR:$dst), BrMiscFrm, IIC_Br, "mov\tpc, $dst", [(brind GPR:$dst)]>, Requires<[IsARM, NoV4T]> { - bits<4> Rm; - + bits<4> dst; let Inst{11-4} = 0b00000000; let Inst{15-12} = 0b1111; let Inst{19-16} = 0b0000; let Inst{27-20} = 0b00011010; let Inst{31-28} = 0b1110; - let Inst{3-0} = Rm; + let Inst{3-0} = dst; } } @@ -999,11 +991,11 @@ let isCall = 1, IIC_Br, "blx\t$func", [(ARMcall GPR:$func)]>, Requires<[IsARM, HasV5T, IsNotDarwin]> { - bits<4> Rm; + bits<4> func; let Inst{7-4} = 0b0011; let Inst{19-8} = 0b111111111111; let Inst{27-20} = 0b00010010; - let Inst{3-0} = Rm; + let Inst{3-0} = func; } // ARMv4T @@ -1513,26 +1505,26 @@ def STM_UPD : AXI4st<(outs GPR:$wb), (ins addrmode4:$addr, pred:$p, let neverHasSideEffects = 1 in def MOVr : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm, IIC_iMOVr, "mov", "\t$dst, $src", []>, UnaryDP { - bits<4> Rd; - bits<4> Rm; + bits<4> dst; + bits<4> src; let Inst{11-4} = 0b00000000; let Inst{25} = 0; - let Inst{3-0} = Rm; - let Inst{15-12} = Rd; + let Inst{3-0} = src; + let Inst{15-12} = dst; } // A version for the smaller set of tail call registers. let neverHasSideEffects = 1 in def MOVr_TC : AsI1<0b1101, (outs tcGPR:$dst), (ins tcGPR:$src), DPFrm, IIC_iMOVr, "mov", "\t$dst, $src", []>, UnaryDP { - bits<4> Rd; - bits<4> Rm; + bits<4> dst; + bits<4> src; let Inst{11-4} = 0b00000000; let Inst{25} = 0; - let Inst{3-0} = Rm; - let Inst{15-12} = Rd; + let Inst{3-0} = src; + let Inst{15-12} = dst; } def MOVs : AsI1<0b1101, (outs GPR:$dst), (ins so_reg:$src), |