mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Fix trailing whitespace and style, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -126,88 +126,58 @@ def addr : ComplexPattern<iPTR, 2, "SelectAddr", [frameindex], []>;
|
||||
let isCommutable = 1 in
|
||||
class ArithR<bits<6> op, bits<6> func, string instr_asm, SDNode OpNode,
|
||||
InstrItinClass itin>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], itin>;
|
||||
|
||||
let isCommutable = 1 in
|
||||
class ArithOverflowR<bits<6> op, bits<6> func, string instr_asm>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[], IIAlu>;
|
||||
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"), [], IIAlu>;
|
||||
|
||||
// Arithmetic 2 register operands
|
||||
class ArithI<bits<6> op, string instr_asm, SDNode OpNode,
|
||||
Operand Od, PatLeaf imm_type> :
|
||||
FI< op,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, Od:$c),
|
||||
FI<op, (outs CPURegs:$dst), (ins CPURegs:$b, Od:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, imm_type:$c))], IIAlu>;
|
||||
|
||||
class ArithOverflowI<bits<6> op, string instr_asm, SDNode OpNode,
|
||||
Operand Od, PatLeaf imm_type> :
|
||||
FI< op,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, Od:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[], IIAlu>;
|
||||
FI<op, (outs CPURegs:$dst), (ins CPURegs:$b, Od:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"), [], IIAlu>;
|
||||
|
||||
// Arithmetic Multiply ADD/SUB
|
||||
let rd=0 in
|
||||
class MArithR<bits<6> func, string instr_asm> :
|
||||
FR< 0x1c,
|
||||
func,
|
||||
(outs CPURegs:$rs),
|
||||
(ins CPURegs:$rt),
|
||||
!strconcat(instr_asm, "\t$rs, $rt"),
|
||||
[], IIImul>;
|
||||
FR<0x1c, func, (outs CPURegs:$rs), (ins CPURegs:$rt),
|
||||
!strconcat(instr_asm, "\t$rs, $rt"), [], IIImul>;
|
||||
|
||||
// Logical
|
||||
class LogicR<bits<6> func, string instr_asm, SDNode OpNode>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
FR<0x00, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>;
|
||||
|
||||
class LogicI<bits<6> op, string instr_asm, SDNode OpNode>:
|
||||
FI< op,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, uimm16:$c),
|
||||
FI<op, (outs CPURegs:$dst), (ins CPURegs:$b, uimm16:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt16:$c))], IIAlu>;
|
||||
|
||||
class LogicNOR<bits<6> op, bits<6> func, string instr_asm>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (not (or CPURegs:$b, CPURegs:$c)))], IIAlu>;
|
||||
|
||||
// Shifts
|
||||
let rt = 0 in
|
||||
class LogicR_shift_imm<bits<6> func, string instr_asm, SDNode OpNode>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, shamt:$c),
|
||||
FR<0x00, func, (outs CPURegs:$dst), (ins CPURegs:$b, shamt:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt5:$c))], IIAlu>;
|
||||
|
||||
class LogicR_shift_reg<bits<6> func, string instr_asm, SDNode OpNode>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
FR<0x00, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>;
|
||||
|
||||
@@ -222,34 +192,25 @@ class LoadUpper<bits<6> op, string instr_asm>:
|
||||
// Memory Load/Store
|
||||
let canFoldAsLoad = 1, hasDelaySlot = 1 in
|
||||
class LoadM<bits<6> op, string instr_asm, PatFrag OpNode>:
|
||||
FI< op,
|
||||
(outs CPURegs:$dst),
|
||||
(ins mem:$addr),
|
||||
FI<op, (outs CPURegs:$dst), (ins mem:$addr),
|
||||
!strconcat(instr_asm, "\t$dst, $addr"),
|
||||
[(set CPURegs:$dst, (OpNode addr:$addr))], IILoad>;
|
||||
|
||||
class StoreM<bits<6> op, string instr_asm, PatFrag OpNode>:
|
||||
FI< op,
|
||||
(outs),
|
||||
(ins CPURegs:$dst, mem:$addr),
|
||||
FI<op, (outs), (ins CPURegs:$dst, mem:$addr),
|
||||
!strconcat(instr_asm, "\t$dst, $addr"),
|
||||
[(OpNode CPURegs:$dst, addr:$addr)], IIStore>;
|
||||
|
||||
// Conditional Branch
|
||||
let isBranch = 1, isTerminator=1, hasDelaySlot = 1 in {
|
||||
class CBranch<bits<6> op, string instr_asm, PatFrag cond_op>:
|
||||
FI< op,
|
||||
(outs),
|
||||
(ins CPURegs:$a, CPURegs:$b, brtarget:$offset),
|
||||
FI<op, (outs), (ins CPURegs:$a, CPURegs:$b, brtarget:$offset),
|
||||
!strconcat(instr_asm, "\t$a, $b, $offset"),
|
||||
[(brcond (cond_op CPURegs:$a, CPURegs:$b), bb:$offset)],
|
||||
IIBranch>;
|
||||
|
||||
|
||||
class CBranchZero<bits<6> op, string instr_asm, PatFrag cond_op>:
|
||||
FI< op,
|
||||
(outs),
|
||||
(ins CPURegs:$src, brtarget:$offset),
|
||||
FI<op, (outs), (ins CPURegs:$src, brtarget:$offset),
|
||||
!strconcat(instr_asm, "\t$src, $offset"),
|
||||
[(brcond (cond_op CPURegs:$src, 0), bb:$offset)],
|
||||
IIBranch>;
|
||||
@@ -258,19 +219,14 @@ class CBranchZero<bits<6> op, string instr_asm, PatFrag cond_op>:
|
||||
// SetCC
|
||||
class SetCC_R<bits<6> op, bits<6> func, string instr_asm,
|
||||
PatFrag cond_op>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, CPURegs:$c),
|
||||
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (cond_op CPURegs:$b, CPURegs:$c))],
|
||||
IIAlu>;
|
||||
|
||||
class SetCC_I<bits<6> op, string instr_asm, PatFrag cond_op,
|
||||
Operand Od, PatLeaf imm_type>:
|
||||
FI< op,
|
||||
(outs CPURegs:$dst),
|
||||
(ins CPURegs:$b, Od:$c),
|
||||
FI<op, (outs CPURegs:$dst), (ins CPURegs:$b, Od:$c),
|
||||
!strconcat(instr_asm, "\t$dst, $b, $c"),
|
||||
[(set CPURegs:$dst, (cond_op CPURegs:$b, imm_type:$c))],
|
||||
IIAlu>;
|
||||
@@ -278,20 +234,13 @@ class SetCC_I<bits<6> op, string instr_asm, PatFrag cond_op,
|
||||
// Unconditional branch
|
||||
let isBranch=1, isTerminator=1, isBarrier=1, hasDelaySlot = 1 in
|
||||
class JumpFJ<bits<6> op, string instr_asm>:
|
||||
FJ< op,
|
||||
(outs),
|
||||
(ins brtarget:$target),
|
||||
!strconcat(instr_asm, "\t$target"),
|
||||
[(br bb:$target)], IIBranch>;
|
||||
FJ<op, (outs), (ins brtarget:$target),
|
||||
!strconcat(instr_asm, "\t$target"), [(br bb:$target)], IIBranch>;
|
||||
|
||||
let isBranch=1, isTerminator=1, isBarrier=1, rd=0, hasDelaySlot = 1 in
|
||||
class JumpFR<bits<6> op, bits<6> func, string instr_asm>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs),
|
||||
(ins CPURegs:$target),
|
||||
!strconcat(instr_asm, "\t$target"),
|
||||
[(brind CPURegs:$target)], IIBranch>;
|
||||
FR<op, func, (outs), (ins CPURegs:$target),
|
||||
!strconcat(instr_asm, "\t$target"), [(brind CPURegs:$target)], IIBranch>;
|
||||
|
||||
// Jump and Link (Call)
|
||||
let isCall=1, hasDelaySlot=1,
|
||||
@@ -299,83 +248,59 @@ let isCall=1, hasDelaySlot=1,
|
||||
Defs = [AT, V0, V1, A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9,
|
||||
K0, K1, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9], Uses = [GP] in {
|
||||
class JumpLink<bits<6> op, string instr_asm>:
|
||||
FJ< op,
|
||||
(outs),
|
||||
(ins calltarget:$target, variable_ops),
|
||||
!strconcat(instr_asm, "\t$target"),
|
||||
[(MipsJmpLink imm:$target)], IIBranch>;
|
||||
FJ<op, (outs), (ins calltarget:$target, variable_ops),
|
||||
!strconcat(instr_asm, "\t$target"), [(MipsJmpLink imm:$target)],
|
||||
IIBranch>;
|
||||
|
||||
let rd=31 in
|
||||
class JumpLinkReg<bits<6> op, bits<6> func, string instr_asm>:
|
||||
FR< op,
|
||||
func,
|
||||
(outs),
|
||||
(ins CPURegs:$rs, variable_ops),
|
||||
!strconcat(instr_asm, "\t$rs"),
|
||||
[(MipsJmpLink CPURegs:$rs)], IIBranch>;
|
||||
FR<op, func, (outs), (ins CPURegs:$rs, variable_ops),
|
||||
!strconcat(instr_asm, "\t$rs"), [(MipsJmpLink CPURegs:$rs)], IIBranch>;
|
||||
|
||||
class BranchLink<string instr_asm>:
|
||||
FI< 0x1,
|
||||
(outs),
|
||||
(ins CPURegs:$rs, brtarget:$target, variable_ops),
|
||||
!strconcat(instr_asm, "\t$rs, $target"),
|
||||
[], IIBranch>;
|
||||
FI<0x1, (outs), (ins CPURegs:$rs, brtarget:$target, variable_ops),
|
||||
!strconcat(instr_asm, "\t$rs, $target"), [], IIBranch>;
|
||||
}
|
||||
|
||||
// Mul, Div
|
||||
class MulDiv<bits<6> func, string instr_asm, InstrItinClass itin>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs),
|
||||
(ins CPURegs:$a, CPURegs:$b),
|
||||
!strconcat(instr_asm, "\t$a, $b"),
|
||||
[], itin>;
|
||||
FR<0x00, func, (outs), (ins CPURegs:$a, CPURegs:$b),
|
||||
!strconcat(instr_asm, "\t$a, $b"), [], itin>;
|
||||
|
||||
// Move from Hi/Lo
|
||||
class MoveFromLOHI<bits<6> func, string instr_asm>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs CPURegs:$dst),
|
||||
(ins),
|
||||
!strconcat(instr_asm, "\t$dst"),
|
||||
[], IIHiLo>;
|
||||
FR<0x00, func, (outs CPURegs:$dst), (ins),
|
||||
!strconcat(instr_asm, "\t$dst"), [], IIHiLo>;
|
||||
|
||||
class MoveToLOHI<bits<6> func, string instr_asm>:
|
||||
FR< 0x00,
|
||||
func,
|
||||
(outs),
|
||||
(ins CPURegs:$src),
|
||||
!strconcat(instr_asm, "\t$src"),
|
||||
[], IIHiLo>;
|
||||
FR<0x00, func, (outs), (ins CPURegs:$src),
|
||||
!strconcat(instr_asm, "\t$src"), [], IIHiLo>;
|
||||
|
||||
class EffectiveAddress<string instr_asm> :
|
||||
FI<0x09,
|
||||
(outs CPURegs:$dst),
|
||||
(ins mem:$addr),
|
||||
instr_asm,
|
||||
[(set CPURegs:$dst, addr:$addr)], IIAlu>;
|
||||
FI<0x09, (outs CPURegs:$dst), (ins mem:$addr),
|
||||
instr_asm, [(set CPURegs:$dst, addr:$addr)], IIAlu>;
|
||||
|
||||
// Count Leading Ones/Zeros in Word
|
||||
class CountLeading<bits<6> func, string instr_asm, SDNode CountOp>:
|
||||
FR< 0x1c, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
FR<0x1c, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
!strconcat(instr_asm, "\t$dst, $src"),
|
||||
[(set CPURegs:$dst, (CountOp CPURegs:$src))], IIAlu>;
|
||||
|
||||
// Sign Extend in Register.
|
||||
class SignExtInReg<bits<6> func, string instr_asm, ValueType vt>:
|
||||
FR< 0x3f, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
FR<0x3f, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
!strconcat(instr_asm, "\t$dst, $src"),
|
||||
[(set CPURegs:$dst, (sext_inreg CPURegs:$src, vt))], NoItinerary>;
|
||||
|
||||
// Byte Swap
|
||||
class ByteSwap<bits<6> func, string instr_asm>:
|
||||
FR< 0x1f, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
FR<0x1f, func, (outs CPURegs:$dst), (ins CPURegs:$src),
|
||||
!strconcat(instr_asm, "\t$dst, $src"),
|
||||
[(set CPURegs:$dst, (bswap CPURegs:$src))], NoItinerary>;
|
||||
|
||||
// Conditional Move
|
||||
class CondMov<bits<6> func, string instr_asm, PatLeaf MovCode>:
|
||||
FR< 0x00, func, (outs CPURegs:$dst), (ins CPURegs:$F, CPURegs:$T,
|
||||
FR<0x00, func, (outs CPURegs:$dst), (ins CPURegs:$F, CPURegs:$T,
|
||||
CPURegs:$cond), !strconcat(instr_asm, "\t$dst, $T, $cond"),
|
||||
[(set CPURegs:$dst, (MipsCMov CPURegs:$F, CPURegs:$T,
|
||||
CPURegs:$cond, MovCode))], NoItinerary>;
|
||||
|
Reference in New Issue
Block a user