mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e5cbaf140b
commit
692433bc2d
@ -20,6 +20,17 @@ let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
|
||||
Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Saturating Arithmentic
|
||||
|
||||
let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
|
||||
def int_arm_qadd : GCCBuiltin<"__builtin_arm_qadd">,
|
||||
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
|
||||
[IntrNoMem, Commutative]>;
|
||||
def int_arm_qsub : GCCBuiltin<"__builtin_arm_qsub">,
|
||||
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Advanced SIMD (NEON)
|
||||
|
||||
|
@ -1714,24 +1714,26 @@ def : ARMPat<(adde GPR:$src, so_imm_not:$imm),
|
||||
|
||||
// ARM Arithmetic Instruction -- for disassembly only
|
||||
// GPR:$dst = GPR:$a op GPR:$b
|
||||
class AAI<bits<8> op27_20, bits<4> op7_4, string opc>
|
||||
class AAI<bits<8> op27_20, bits<4> op7_4, string opc,
|
||||
list<dag> pattern = [/* For disassembly only; pattern left blank */]>
|
||||
: AI<(outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm, IIC_iALUr,
|
||||
opc, "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]> {
|
||||
opc, "\t$dst, $a, $b", pattern> {
|
||||
let Inst{27-20} = op27_20;
|
||||
let Inst{7-4} = op7_4;
|
||||
}
|
||||
|
||||
// Saturating add/subtract -- for disassembly only
|
||||
|
||||
def QADD : AAI<0b00010000, 0b0101, "qadd">;
|
||||
def QADD : AAI<0b00010000, 0b0101, "qadd",
|
||||
[(set GPR:$dst, (int_arm_qadd GPR:$a, GPR:$b))]>;
|
||||
def QADD16 : AAI<0b01100010, 0b0001, "qadd16">;
|
||||
def QADD8 : AAI<0b01100010, 0b1001, "qadd8">;
|
||||
def QASX : AAI<0b01100010, 0b0011, "qasx">;
|
||||
def QDADD : AAI<0b00010100, 0b0101, "qdadd">;
|
||||
def QDSUB : AAI<0b00010110, 0b0101, "qdsub">;
|
||||
def QSAX : AAI<0b01100010, 0b0101, "qsax">;
|
||||
def QSUB : AAI<0b00010010, 0b0101, "qsub">;
|
||||
def QSUB : AAI<0b00010010, 0b0101, "qsub",
|
||||
[(set GPR:$dst, (int_arm_qsub GPR:$a, GPR:$b))]>;
|
||||
def QSUB16 : AAI<0b01100010, 0b0111, "qsub16">;
|
||||
def QSUB8 : AAI<0b01100010, 0b1111, "qsub8">;
|
||||
def UQADD16 : AAI<0b01100110, 0b0001, "uqadd16">;
|
||||
|
@ -1441,9 +1441,10 @@ def t2SEL : T2I<(outs GPR:$dst), (ins GPR:$a, GPR:$b), NoItinerary, "sel",
|
||||
|
||||
// A6.3.13, A6.3.14, A6.3.15 Parallel addition and subtraction (signed/unsigned)
|
||||
// And Miscellaneous operations -- for disassembly only
|
||||
class T2I_pam<bits<3> op22_20, bits<4> op7_4, string opc>
|
||||
class T2I_pam<bits<3> op22_20, bits<4> op7_4, string opc,
|
||||
list<dag> pat = [/* For disassembly only; pattern left blank */]>
|
||||
: T2I<(outs GPR:$dst), (ins GPR:$a, GPR:$b), NoItinerary, opc,
|
||||
"\t$dst, $a, $b", [/* For disassembly only; pattern left blank */]> {
|
||||
"\t$dst, $a, $b", pat> {
|
||||
let Inst{31-27} = 0b11111;
|
||||
let Inst{26-23} = 0b0101;
|
||||
let Inst{22-20} = op22_20;
|
||||
@ -1453,14 +1454,16 @@ class T2I_pam<bits<3> op22_20, bits<4> op7_4, string opc>
|
||||
|
||||
// Saturating add/subtract -- for disassembly only
|
||||
|
||||
def t2QADD : T2I_pam<0b000, 0b1000, "qadd">;
|
||||
def t2QADD : T2I_pam<0b000, 0b1000, "qadd",
|
||||
[(set GPR:$dst, (int_arm_qadd GPR:$a, GPR:$b))]>;
|
||||
def t2QADD16 : T2I_pam<0b001, 0b0001, "qadd16">;
|
||||
def t2QADD8 : T2I_pam<0b000, 0b0001, "qadd8">;
|
||||
def t2QASX : T2I_pam<0b010, 0b0001, "qasx">;
|
||||
def t2QDADD : T2I_pam<0b000, 0b1001, "qdadd">;
|
||||
def t2QDSUB : T2I_pam<0b000, 0b1011, "qdsub">;
|
||||
def t2QSAX : T2I_pam<0b110, 0b0001, "qsax">;
|
||||
def t2QSUB : T2I_pam<0b000, 0b1010, "qsub">;
|
||||
def t2QSUB : T2I_pam<0b000, 0b1010, "qsub",
|
||||
[(set GPR:$dst, (int_arm_qsub GPR:$a, GPR:$b))]>;
|
||||
def t2QSUB16 : T2I_pam<0b101, 0b0001, "qsub16">;
|
||||
def t2QSUB8 : T2I_pam<0b100, 0b0001, "qsub8">;
|
||||
def t2UQADD16 : T2I_pam<0b001, 0b0101, "uqadd16">;
|
||||
|
Loading…
x
Reference in New Issue
Block a user