2006-05-14 22:18:28 +00:00
|
|
|
//===- ARMInstrInfo.td - Target Description for ARM Target ----------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the "Instituto Nokia de Tecnologia" and
|
|
|
|
// is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file describes the ARM instructions in TableGen format.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-07-11 11:36:48 +00:00
|
|
|
// Address operands
|
2006-09-11 17:25:40 +00:00
|
|
|
def op_addr_mode1 : Operand<iPTR> {
|
|
|
|
let PrintMethod = "printAddrMode1";
|
2006-09-13 12:09:43 +00:00
|
|
|
let MIOperandInfo = (ops ptr_rc, ptr_rc, i32imm);
|
2006-09-11 17:25:40 +00:00
|
|
|
}
|
|
|
|
|
2006-10-17 18:04:53 +00:00
|
|
|
def op_addr_mode5 : Operand<iPTR> {
|
|
|
|
let PrintMethod = "printAddrMode5";
|
|
|
|
let MIOperandInfo = (ops ptr_rc, i32imm);
|
|
|
|
}
|
|
|
|
|
2006-07-11 11:36:48 +00:00
|
|
|
def memri : Operand<iPTR> {
|
|
|
|
let PrintMethod = "printMemRegImm";
|
|
|
|
let MIOperandInfo = (ops i32imm, ptr_rc);
|
|
|
|
}
|
|
|
|
|
2006-07-10 01:41:35 +00:00
|
|
|
// Define ARM specific addressing mode.
|
2006-09-11 17:25:40 +00:00
|
|
|
//Addressing Mode 1: data processing operands
|
2006-10-11 21:03:53 +00:00
|
|
|
def addr_mode1 : ComplexPattern<iPTR, 3, "SelectAddrMode1", [imm, sra, shl, srl],
|
|
|
|
[]>;
|
2006-09-11 17:25:40 +00:00
|
|
|
|
2006-10-17 18:04:53 +00:00
|
|
|
//Addressing Mode 5: VFP load/store
|
|
|
|
def addr_mode5 : ComplexPattern<iPTR, 2, "SelectAddrMode5", [], []>;
|
|
|
|
|
2006-07-11 11:36:48 +00:00
|
|
|
//register plus/minus 12 bit offset
|
2006-10-11 21:03:53 +00:00
|
|
|
def iaddr : ComplexPattern<iPTR, 2, "SelectAddrRegImm", [frameindex], []>;
|
2006-07-11 11:36:48 +00:00
|
|
|
//register plus scaled register
|
2006-10-11 21:03:53 +00:00
|
|
|
//def raddr : ComplexPattern<iPTR, 2, "SelectAddrRegReg", [], []>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2006-10-16 17:57:20 +00:00
|
|
|
// Instruction Class Templates
|
2006-05-14 22:18:28 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
class InstARM<dag ops, string asmstr, list<dag> pattern> : Instruction {
|
|
|
|
let Namespace = "ARM";
|
|
|
|
|
|
|
|
dag OperandList = ops;
|
|
|
|
let AsmString = asmstr;
|
|
|
|
let Pattern = pattern;
|
|
|
|
}
|
|
|
|
|
2006-10-16 17:57:20 +00:00
|
|
|
class IntBinOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops IntRegs:$dst, IntRegs:$a, IntRegs:$b),
|
|
|
|
!strconcat(OpcStr, " $dst, $a, $b"),
|
|
|
|
[(set IntRegs:$dst, (OpNode IntRegs:$a, IntRegs:$b))]>;
|
|
|
|
|
2006-10-16 18:32:36 +00:00
|
|
|
class FPBinOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops FPRegs:$dst, FPRegs:$a, FPRegs:$b),
|
|
|
|
!strconcat(OpcStr, " $dst, $a, $b"),
|
|
|
|
[(set FPRegs:$dst, (OpNode FPRegs:$a, FPRegs:$b))]>;
|
|
|
|
|
2006-10-16 18:39:22 +00:00
|
|
|
class DFPBinOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops DFPRegs:$dst, DFPRegs:$a, DFPRegs:$b),
|
|
|
|
!strconcat(OpcStr, " $dst, $a, $b"),
|
|
|
|
[(set DFPRegs:$dst, (OpNode DFPRegs:$a, DFPRegs:$b))]>;
|
|
|
|
|
2006-10-17 20:45:22 +00:00
|
|
|
class FPUnaryOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|
|
|
!strconcat(OpcStr, " $dst, $src"),
|
|
|
|
[(set FPRegs:$dst, (OpNode FPRegs:$src))]>;
|
|
|
|
|
|
|
|
class DFPUnaryOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops DFPRegs:$dst, DFPRegs:$src),
|
|
|
|
!strconcat(OpcStr, " $dst, $src"),
|
|
|
|
[(set DFPRegs:$dst, (OpNode DFPRegs:$src))]>;
|
|
|
|
|
2006-10-16 18:18:14 +00:00
|
|
|
class Addr1BinOp<string OpcStr, SDNode OpNode> :
|
|
|
|
InstARM<(ops IntRegs:$dst, IntRegs:$a, op_addr_mode1:$b),
|
|
|
|
!strconcat(OpcStr, " $dst, $a, $b"),
|
|
|
|
[(set IntRegs:$dst, (OpNode IntRegs:$a, addr_mode1:$b))]>;
|
|
|
|
|
2006-10-16 17:57:20 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Instructions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-08-24 13:45:55 +00:00
|
|
|
def brtarget : Operand<OtherVT>;
|
|
|
|
|
2006-08-24 16:13:15 +00:00
|
|
|
// Operand for printing out a condition code.
|
|
|
|
let PrintMethod = "printCCOperand" in
|
|
|
|
def CCOp : Operand<i32>;
|
|
|
|
|
2006-05-14 22:18:28 +00:00
|
|
|
def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>;
|
2006-08-11 09:03:33 +00:00
|
|
|
def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq,
|
|
|
|
[SDNPHasChain, SDNPOutFlag]>;
|
|
|
|
def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARMCallSeq,
|
|
|
|
[SDNPHasChain, SDNPOutFlag]>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
2006-07-16 01:02:57 +00:00
|
|
|
def SDT_ARMcall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
|
|
|
|
def ARMcall : SDNode<"ARMISD::CALL", SDT_ARMcall,
|
|
|
|
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
|
2006-08-03 17:02:20 +00:00
|
|
|
def retflag : SDNode<"ARMISD::RET_FLAG", SDTRet,
|
|
|
|
[SDNPHasChain, SDNPOptInFlag]>;
|
2006-08-24 17:19:08 +00:00
|
|
|
|
|
|
|
def SDTarmselect : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisVT<2, i32>]>;
|
|
|
|
def armselect : SDNode<"ARMISD::SELECT", SDTarmselect, [SDNPInFlag, SDNPOutFlag]>;
|
2006-08-21 22:00:32 +00:00
|
|
|
|
2006-10-10 12:56:00 +00:00
|
|
|
def SDTarmfmstat : SDTypeProfile<0, 0, []>;
|
|
|
|
def armfmstat : SDNode<"ARMISD::FMSTAT", SDTarmfmstat, [SDNPInFlag, SDNPOutFlag]>;
|
|
|
|
|
2006-08-24 16:13:15 +00:00
|
|
|
def SDTarmbr : SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>;
|
2006-08-24 13:45:55 +00:00
|
|
|
def armbr : SDNode<"ARMISD::BR", SDTarmbr, [SDNPHasChain, SDNPInFlag]>;
|
|
|
|
|
2006-08-21 22:00:32 +00:00
|
|
|
def SDTVoidBinOp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
|
|
|
|
def armcmp : SDNode<"ARMISD::CMP", SDTVoidBinOp, [SDNPOutFlag]>;
|
2006-07-16 01:02:57 +00:00
|
|
|
|
2006-10-07 14:24:52 +00:00
|
|
|
def armfsitos : SDNode<"ARMISD::FSITOS", SDTUnaryOp>;
|
2006-10-10 18:55:14 +00:00
|
|
|
def armftosis : SDNode<"ARMISD::FTOSIS", SDTUnaryOp>;
|
2006-10-02 19:30:56 +00:00
|
|
|
def armfsitod : SDNode<"ARMISD::FSITOD", SDTUnaryOp>;
|
2006-10-10 18:55:14 +00:00
|
|
|
def armftosid : SDNode<"ARMISD::FTOSID", SDTUnaryOp>;
|
2006-10-07 14:24:52 +00:00
|
|
|
def armfuitos : SDNode<"ARMISD::FUITOS", SDTUnaryOp>;
|
2006-10-10 20:38:57 +00:00
|
|
|
def armftouis : SDNode<"ARMISD::FTOUIS", SDTUnaryOp>;
|
2006-10-07 14:24:52 +00:00
|
|
|
def armfuitod : SDNode<"ARMISD::FUITOD", SDTUnaryOp>;
|
2006-10-10 20:38:57 +00:00
|
|
|
def armftouid : SDNode<"ARMISD::FTOUID", SDTUnaryOp>;
|
2006-10-02 19:30:56 +00:00
|
|
|
|
|
|
|
def SDTarmfmrrd : SDTypeProfile<0, 3, [SDTCisInt<0>, SDTCisInt<1>, SDTCisFP<2>]>;
|
2006-10-06 20:33:26 +00:00
|
|
|
def armfmrrd : SDNode<"ARMISD::FMRRD", SDTarmfmrrd,
|
|
|
|
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
|
2006-09-29 21:20:16 +00:00
|
|
|
|
2006-10-05 16:48:49 +00:00
|
|
|
def SDTarmfmdrr : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisInt<1>, SDTCisInt<2>]>;
|
|
|
|
def armfmdrr : SDNode<"ARMISD::FMDRR", SDTarmfmdrr, []>;
|
|
|
|
|
2006-05-14 22:18:28 +00:00
|
|
|
def ADJCALLSTACKUP : InstARM<(ops i32imm:$amt),
|
|
|
|
"!ADJCALLSTACKUP $amt",
|
2006-10-12 18:00:26 +00:00
|
|
|
[(callseq_end imm:$amt)]>, Imp<[R13],[R13]>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
|
|
|
def ADJCALLSTACKDOWN : InstARM<(ops i32imm:$amt),
|
|
|
|
"!ADJCALLSTACKDOWN $amt",
|
2006-10-12 18:00:26 +00:00
|
|
|
[(callseq_start imm:$amt)]>, Imp<[R13],[R13]>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
2006-10-19 13:45:00 +00:00
|
|
|
def IMPLICIT_DEF_Int : InstARM<(ops IntRegs:$dst),
|
|
|
|
"@IMPLICIT_DEF $dst",
|
|
|
|
[(set IntRegs:$dst, (undef))]>;
|
|
|
|
def IMPLICIT_DEF_FP : InstARM<(ops FPRegs:$dst), "@IMPLICIT_DEF $dst",
|
|
|
|
[(set FPRegs:$dst, (undef))]>;
|
|
|
|
def IMPLICIT_DEF_DFP : InstARM<(ops DFPRegs:$dst), "@IMPLICIT_DEF $dst",
|
|
|
|
[(set DFPRegs:$dst, (undef))]>;
|
|
|
|
|
2006-07-18 17:00:30 +00:00
|
|
|
let isReturn = 1 in {
|
2006-08-03 17:02:20 +00:00
|
|
|
def bx: InstARM<(ops), "bx r14", [(retflag)]>;
|
2006-07-18 17:00:30 +00:00
|
|
|
}
|
2006-05-18 21:45:49 +00:00
|
|
|
|
2006-10-16 21:10:32 +00:00
|
|
|
let noResults = 1, Defs = [R0, R1, R2, R3, R14] in {
|
|
|
|
def bl: InstARM<(ops i32imm:$func, variable_ops), "bl $func", []>;
|
2006-10-18 16:21:43 +00:00
|
|
|
def blx : InstARM<(ops IntRegs:$func, variable_ops), "blx $func", [(ARMcall IntRegs:$func)]>;
|
2006-08-01 18:53:10 +00:00
|
|
|
}
|
2006-07-16 01:02:57 +00:00
|
|
|
|
2006-07-11 11:36:48 +00:00
|
|
|
def ldr : InstARM<(ops IntRegs:$dst, memri:$addr),
|
2006-08-01 18:53:10 +00:00
|
|
|
"ldr $dst, $addr",
|
2006-07-11 11:36:48 +00:00
|
|
|
[(set IntRegs:$dst, (load iaddr:$addr))]>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
2006-10-16 17:17:22 +00:00
|
|
|
def LDRB : InstARM<(ops IntRegs:$dst, IntRegs:$addr),
|
2006-10-16 17:38:12 +00:00
|
|
|
"ldrb $dst, [$addr]",
|
2006-10-16 17:17:22 +00:00
|
|
|
[(set IntRegs:$dst, (zextloadi8 IntRegs:$addr))]>;
|
|
|
|
|
|
|
|
def LDRSB : InstARM<(ops IntRegs:$dst, IntRegs:$addr),
|
2006-10-16 17:38:12 +00:00
|
|
|
"ldrsb $dst, [$addr]",
|
2006-10-16 17:17:22 +00:00
|
|
|
[(set IntRegs:$dst, (sextloadi8 IntRegs:$addr))]>;
|
|
|
|
|
|
|
|
def LDRH : InstARM<(ops IntRegs:$dst, IntRegs:$addr),
|
2006-10-16 17:38:12 +00:00
|
|
|
"ldrh $dst, [$addr]",
|
2006-10-16 17:17:22 +00:00
|
|
|
[(set IntRegs:$dst, (zextloadi16 IntRegs:$addr))]>;
|
|
|
|
|
|
|
|
def LDRSH : InstARM<(ops IntRegs:$dst, IntRegs:$addr),
|
2006-10-16 17:38:12 +00:00
|
|
|
"ldrsh $dst, [$addr]",
|
2006-10-16 17:17:22 +00:00
|
|
|
[(set IntRegs:$dst, (sextloadi16 IntRegs:$addr))]>;
|
|
|
|
|
2006-08-08 20:35:03 +00:00
|
|
|
def str : InstARM<(ops IntRegs:$src, memri:$addr),
|
|
|
|
"str $src, $addr",
|
|
|
|
[(store IntRegs:$src, iaddr:$addr)]>;
|
2006-05-14 22:18:28 +00:00
|
|
|
|
2006-10-23 20:34:27 +00:00
|
|
|
def STRB : InstARM<(ops IntRegs:$src, IntRegs:$addr),
|
|
|
|
"strb $src, [$addr]",
|
|
|
|
[(truncstorei8 IntRegs:$src, IntRegs:$addr)]>;
|
|
|
|
|
|
|
|
def STRH : InstARM<(ops IntRegs:$src, IntRegs:$addr),
|
|
|
|
"strh $src, [$addr]",
|
|
|
|
[(truncstorei16 IntRegs:$src, IntRegs:$addr)]>;
|
|
|
|
|
2006-09-11 17:25:40 +00:00
|
|
|
def MOV : InstARM<(ops IntRegs:$dst, op_addr_mode1:$src),
|
|
|
|
"mov $dst, $src", [(set IntRegs:$dst, addr_mode1:$src)]>;
|
2006-06-18 00:08:07 +00:00
|
|
|
|
2006-10-16 18:18:14 +00:00
|
|
|
def ADD : Addr1BinOp<"add", add>;
|
|
|
|
def ADCS : Addr1BinOp<"adcs", adde>;
|
|
|
|
def ADDS : Addr1BinOp<"adds", addc>;
|
2006-10-09 17:18:28 +00:00
|
|
|
|
2006-08-17 17:09:40 +00:00
|
|
|
// "LEA" forms of add
|
|
|
|
def lea_addri : InstARM<(ops IntRegs:$dst, memri:$addr),
|
|
|
|
"add $dst, ${addr:arith}",
|
|
|
|
[(set IntRegs:$dst, iaddr:$addr)]>;
|
|
|
|
|
|
|
|
|
2006-10-16 18:18:14 +00:00
|
|
|
def SUB : Addr1BinOp<"sub", sub>;
|
|
|
|
def SBCS : Addr1BinOp<"sbcs", sube>;
|
|
|
|
def SUBS : Addr1BinOp<"subs", subc>;
|
|
|
|
def AND : Addr1BinOp<"and", and>;
|
|
|
|
def EOR : Addr1BinOp<"eor", xor>;
|
|
|
|
def ORR : Addr1BinOp<"orr", or>;
|
2006-09-08 16:59:47 +00:00
|
|
|
|
2006-08-21 22:00:32 +00:00
|
|
|
let isTwoAddress = 1 in {
|
2006-09-11 17:25:40 +00:00
|
|
|
def movcond : InstARM<(ops IntRegs:$dst, IntRegs:$false,
|
|
|
|
op_addr_mode1:$true, CCOp:$cc),
|
2006-08-24 17:19:08 +00:00
|
|
|
"mov$cc $dst, $true",
|
2006-09-11 17:25:40 +00:00
|
|
|
[(set IntRegs:$dst, (armselect addr_mode1:$true,
|
|
|
|
IntRegs:$false, imm:$cc))]>;
|
2006-08-21 22:00:32 +00:00
|
|
|
}
|
|
|
|
|
2006-10-16 17:57:20 +00:00
|
|
|
def MUL : IntBinOp<"mul", mul>;
|
2006-09-11 19:24:19 +00:00
|
|
|
|
2006-10-16 16:33:29 +00:00
|
|
|
let Defs = [R0] in {
|
2006-10-16 17:57:20 +00:00
|
|
|
def SMULL : IntBinOp<"smull r12,", mulhs>;
|
|
|
|
def UMULL : IntBinOp<"umull r12,", mulhu>;
|
2006-10-16 16:33:29 +00:00
|
|
|
}
|
|
|
|
|
2006-10-24 16:47:57 +00:00
|
|
|
let isTerminator = 1, isBranch = 1 in {
|
2006-10-18 16:20:57 +00:00
|
|
|
def bcond : InstARM<(ops brtarget:$dst, CCOp:$cc),
|
|
|
|
"b$cc $dst",
|
|
|
|
[(armbr bb:$dst, imm:$cc)]>;
|
|
|
|
|
|
|
|
def b : InstARM<(ops brtarget:$dst),
|
|
|
|
"b $dst",
|
|
|
|
[(br bb:$dst)]>;
|
|
|
|
}
|
2006-09-08 12:47:03 +00:00
|
|
|
|
2006-09-11 17:25:40 +00:00
|
|
|
def cmp : InstARM<(ops IntRegs:$a, op_addr_mode1:$b),
|
2006-08-21 22:00:32 +00:00
|
|
|
"cmp $a, $b",
|
2006-09-11 17:25:40 +00:00
|
|
|
[(armcmp IntRegs:$a, addr_mode1:$b)]>;
|
2006-09-29 21:20:16 +00:00
|
|
|
|
2006-10-10 12:56:00 +00:00
|
|
|
// Floating Point Compare
|
2006-10-13 13:14:59 +00:00
|
|
|
def fcmps : InstARM<(ops FPRegs:$a, FPRegs:$b),
|
|
|
|
"fcmps $a, $b",
|
|
|
|
[(armcmp FPRegs:$a, FPRegs:$b)]>;
|
|
|
|
|
|
|
|
def fcmpd : InstARM<(ops DFPRegs:$a, DFPRegs:$b),
|
|
|
|
"fcmpd $a, $b",
|
2006-10-10 16:33:47 +00:00
|
|
|
[(armcmp DFPRegs:$a, DFPRegs:$b)]>;
|
|
|
|
|
2006-10-17 13:13:23 +00:00
|
|
|
// Floating Point Copy
|
|
|
|
def FCPYS : InstARM<(ops FPRegs:$dst, FPRegs:$src), "fcpys $dst, $src", []>;
|
|
|
|
|
|
|
|
def FCPYD : InstARM<(ops DFPRegs:$dst, DFPRegs:$src), "fcpyd $dst, $src", []>;
|
|
|
|
|
2006-09-29 21:20:16 +00:00
|
|
|
// Floating Point Conversion
|
|
|
|
// We use bitconvert for moving the data between the register classes.
|
|
|
|
// The format conversion is done with ARM specific nodes
|
|
|
|
|
|
|
|
def FMSR : InstARM<(ops FPRegs:$dst, IntRegs:$src),
|
|
|
|
"fmsr $dst, $src", [(set FPRegs:$dst, (bitconvert IntRegs:$src))]>;
|
|
|
|
|
|
|
|
def FMRS : InstARM<(ops IntRegs:$dst, FPRegs:$src),
|
|
|
|
"fmrs $dst, $src", [(set IntRegs:$dst, (bitconvert FPRegs:$src))]>;
|
|
|
|
|
2006-10-02 19:30:56 +00:00
|
|
|
def FMRRD : InstARM<(ops IntRegs:$i0, IntRegs:$i1, DFPRegs:$src),
|
|
|
|
"fmrrd $i0, $i1, $src", [(armfmrrd IntRegs:$i0, IntRegs:$i1, DFPRegs:$src)]>;
|
|
|
|
|
2006-10-05 16:48:49 +00:00
|
|
|
def FMDRR : InstARM<(ops DFPRegs:$dst, IntRegs:$i0, IntRegs:$i1),
|
|
|
|
"fmdrr $dst, $i0, $i1", [(set DFPRegs:$dst, (armfmdrr IntRegs:$i0, IntRegs:$i1))]>;
|
|
|
|
|
2006-09-29 21:20:16 +00:00
|
|
|
def FSITOS : InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|
|
|
"fsitos $dst, $src", [(set FPRegs:$dst, (armfsitos FPRegs:$src))]>;
|
2006-10-02 19:30:56 +00:00
|
|
|
|
2006-10-10 18:55:14 +00:00
|
|
|
def FTOSIS : InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|
|
|
"ftosis $dst, $src", [(set FPRegs:$dst, (armftosis FPRegs:$src))]>;
|
|
|
|
|
2006-10-02 19:30:56 +00:00
|
|
|
def FSITOD : InstARM<(ops DFPRegs:$dst, FPRegs:$src),
|
|
|
|
"fsitod $dst, $src", [(set DFPRegs:$dst, (armfsitod FPRegs:$src))]>;
|
2006-10-07 13:46:42 +00:00
|
|
|
|
2006-10-10 18:55:14 +00:00
|
|
|
def FTOSID : InstARM<(ops FPRegs:$dst, DFPRegs:$src),
|
|
|
|
"ftosid $dst, $src", [(set FPRegs:$dst, (armftosid DFPRegs:$src))]>;
|
|
|
|
|
2006-10-07 14:24:52 +00:00
|
|
|
def FUITOS : InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|
|
|
"fuitos $dst, $src", [(set FPRegs:$dst, (armfuitos FPRegs:$src))]>;
|
|
|
|
|
2006-10-10 20:38:57 +00:00
|
|
|
def FTOUIS : InstARM<(ops FPRegs:$dst, FPRegs:$src),
|
|
|
|
"ftouis $dst, $src", [(set FPRegs:$dst, (armftouis FPRegs:$src))]>;
|
|
|
|
|
2006-10-07 14:24:52 +00:00
|
|
|
def FUITOD : InstARM<(ops DFPRegs:$dst, FPRegs:$src),
|
|
|
|
"fuitod $dst, $src", [(set DFPRegs:$dst, (armfuitod FPRegs:$src))]>;
|
|
|
|
|
2006-10-10 20:38:57 +00:00
|
|
|
def FTOUID : InstARM<(ops FPRegs:$dst, DFPRegs:$src),
|
|
|
|
"ftouid $dst, $src", [(set FPRegs:$dst, (armftouid DFPRegs:$src))]>;
|
|
|
|
|
2006-10-09 17:50:29 +00:00
|
|
|
def FCVTDS : InstARM<(ops DFPRegs:$dst, FPRegs:$src),
|
|
|
|
"fcvtds $dst, $src", [(set DFPRegs:$dst, (fextend FPRegs:$src))]>;
|
|
|
|
|
|
|
|
def FCVTSD : InstARM<(ops FPRegs:$dst, DFPRegs:$src),
|
|
|
|
"fcvtsd $dst, $src", [(set FPRegs:$dst, (fround DFPRegs:$src))]>;
|
2006-10-07 13:46:42 +00:00
|
|
|
|
2006-10-10 12:56:00 +00:00
|
|
|
def FMSTAT : InstARM<(ops ), "fmstat", [(armfmstat)]>;
|
|
|
|
|
2006-10-07 13:46:42 +00:00
|
|
|
// Floating Point Arithmetic
|
2006-10-16 18:39:22 +00:00
|
|
|
def FADDS : FPBinOp<"fadds", fadd>;
|
|
|
|
def FADDD : DFPBinOp<"faddd", fadd>;
|
|
|
|
def FSUBS : FPBinOp<"fsubs", fsub>;
|
|
|
|
def FSUBD : DFPBinOp<"fsubd", fsub>;
|
2006-10-10 19:35:01 +00:00
|
|
|
|
2006-10-17 20:45:22 +00:00
|
|
|
def FNEGS : FPUnaryOp<"fnegs", fneg>;
|
|
|
|
def FNEGD : DFPUnaryOp<"fnegd", fneg>;
|
|
|
|
def FABSS : FPUnaryOp<"fabss", fabs>;
|
|
|
|
def FABSD : DFPUnaryOp<"fabsd", fabs>;
|
2006-10-17 20:33:13 +00:00
|
|
|
|
2006-10-16 18:32:36 +00:00
|
|
|
def FMULS : FPBinOp<"fmuls", fmul>;
|
2006-10-16 18:39:22 +00:00
|
|
|
def FMULD : DFPBinOp<"fmuld", fmul>;
|
2006-10-16 21:50:04 +00:00
|
|
|
def FDIVS : FPBinOp<"fdivs", fdiv>;
|
|
|
|
def FDIVD : DFPBinOp<"fdivd", fdiv>;
|
2006-10-07 14:03:39 +00:00
|
|
|
|
|
|
|
// Floating Point Load
|
2006-10-17 18:04:53 +00:00
|
|
|
def FLDS : InstARM<(ops FPRegs:$dst, op_addr_mode5:$addr),
|
|
|
|
"flds $dst, $addr",
|
|
|
|
[(set FPRegs:$dst, (load addr_mode5:$addr))]>;
|
2006-10-07 14:03:39 +00:00
|
|
|
|
2006-10-17 18:04:53 +00:00
|
|
|
def FLDD : InstARM<(ops DFPRegs:$dst, op_addr_mode5:$addr),
|
|
|
|
"fldd $dst, $addr",
|
|
|
|
[(set DFPRegs:$dst, (load addr_mode5:$addr))]>;
|
2006-10-16 21:10:32 +00:00
|
|
|
|
2006-10-17 13:36:07 +00:00
|
|
|
// Floating Point Store
|
2006-10-17 18:04:53 +00:00
|
|
|
def FSTS : InstARM<(ops FPRegs:$src, op_addr_mode5:$addr),
|
2006-10-17 18:29:14 +00:00
|
|
|
"fsts $src, $addr",
|
2006-10-17 18:04:53 +00:00
|
|
|
[(store FPRegs:$src, addr_mode5:$addr)]>;
|
2006-10-17 13:36:07 +00:00
|
|
|
|
2006-10-17 18:04:53 +00:00
|
|
|
def FSTD : InstARM<(ops DFPRegs:$src, op_addr_mode5:$addr),
|
2006-10-17 18:29:14 +00:00
|
|
|
"fstd $src, $addr",
|
2006-10-17 18:04:53 +00:00
|
|
|
[(store DFPRegs:$src, addr_mode5:$addr)]>;
|
2006-10-17 13:36:07 +00:00
|
|
|
|
2006-10-16 21:10:32 +00:00
|
|
|
def : Pat<(ARMcall tglobaladdr:$dst),
|
|
|
|
(bl tglobaladdr:$dst)>;
|
|
|
|
|
|
|
|
def : Pat<(ARMcall texternalsym:$dst),
|
|
|
|
(bl texternalsym:$dst)>;
|
2006-10-19 17:05:03 +00:00
|
|
|
|
|
|
|
def : Pat<(extloadi8 IntRegs:$addr),
|
|
|
|
(LDRB IntRegs:$addr)>;
|
|
|
|
def : Pat<(extloadi16 IntRegs:$addr),
|
|
|
|
(LDRH IntRegs:$addr)>;
|
2006-11-01 14:13:27 +00:00
|
|
|
|
|
|
|
// zextload bool -> zextload byte
|
|
|
|
def : Pat<(i32 (zextloadi1 IntRegs:$addr)), (LDRB IntRegs:$addr)>;
|
|
|
|
def : Pat<(i32 (zextloadi1 IntRegs:$addr)), (LDRB IntRegs:$addr)>;
|
|
|
|
|
|
|
|
// truncstore bool -> truncstore byte.
|
|
|
|
def : Pat<(truncstorei1 IntRegs:$src, IntRegs:$addr),
|
|
|
|
(STRB IntRegs:$addr, IntRegs:$src)>;
|
|
|
|
def : Pat<(truncstorei1 IntRegs:$src, IntRegs:$addr),
|
|
|
|
(STRB IntRegs:$addr, IntRegs:$src)>;
|