2007-01-19 07:51:42 +00:00
|
|
|
//===- ARMInstrVFP.td - VFP support for ARM -------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2008-09-11 21:41:29 +00:00
|
|
|
// This file describes the ARM VFP instruction set.
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def SDT_FTOI :
|
|
|
|
SDTypeProfile<1, 1, [SDTCisVT<0, f32>, SDTCisFP<1>]>;
|
|
|
|
def SDT_ITOF :
|
|
|
|
SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisVT<1, f32>]>;
|
|
|
|
def SDT_CMPFP0 :
|
|
|
|
SDTypeProfile<0, 1, [SDTCisFP<0>]>;
|
|
|
|
def SDT_FMDRR :
|
|
|
|
SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisVT<1, i32>,
|
|
|
|
SDTCisSameAs<1, 2>]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def arm_ftoui : SDNode<"ARMISD::FTOUI", SDT_FTOI>;
|
|
|
|
def arm_ftosi : SDNode<"ARMISD::FTOSI", SDT_FTOI>;
|
|
|
|
def arm_sitof : SDNode<"ARMISD::SITOF", SDT_ITOF>;
|
|
|
|
def arm_uitof : SDNode<"ARMISD::UITOF", SDT_ITOF>;
|
2008-01-15 22:02:54 +00:00
|
|
|
def arm_fmstat : SDNode<"ARMISD::FMSTAT", SDTNone, [SDNPInFlag,SDNPOutFlag]>;
|
2008-11-11 02:11:05 +00:00
|
|
|
def arm_cmpfp : SDNode<"ARMISD::CMPFP", SDT_ARMCmp, [SDNPOutFlag]>;
|
|
|
|
def arm_cmpfp0 : SDNode<"ARMISD::CMPFPw0",SDT_CMPFP0, [SDNPOutFlag]>;
|
|
|
|
def arm_fmdrr : SDNode<"ARMISD::FMDRR", SDT_FMDRR>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Load / store Instructions.
|
|
|
|
//
|
|
|
|
|
2008-12-03 18:15:48 +00:00
|
|
|
let canFoldAsLoad = 1 in {
|
2008-11-11 21:48:44 +00:00
|
|
|
def FLDD : ADI5<0b1101, 0b01, (outs DPR:$dst), (ins addrmode5:$addr),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpLoad64, "fldd", "\t$dst, $addr",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (load addrmode5:$addr))]>;
|
|
|
|
|
2008-11-11 21:48:44 +00:00
|
|
|
def FLDS : ASI5<0b1101, 0b01, (outs SPR:$dst), (ins addrmode5:$addr),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpLoad32, "flds", "\t$dst, $addr",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (load addrmode5:$addr))]>;
|
2008-12-03 18:15:48 +00:00
|
|
|
} // canFoldAsLoad
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 21:48:44 +00:00
|
|
|
def FSTD : ADI5<0b1101, 0b00, (outs), (ins DPR:$src, addrmode5:$addr),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpStore64, "fstd", "\t$src, $addr",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(store DPR:$src, addrmode5:$addr)]>;
|
|
|
|
|
2008-11-11 21:48:44 +00:00
|
|
|
def FSTS : ASI5<0b1101, 0b00, (outs), (ins SPR:$src, addrmode5:$addr),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpStore32, "fsts", "\t$src, $addr",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(store SPR:$src, addrmode5:$addr)]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Load / store multiple Instructions.
|
|
|
|
//
|
|
|
|
|
2009-10-01 08:22:27 +00:00
|
|
|
let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
|
2009-10-01 01:33:39 +00:00
|
|
|
def FLDMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-21 20:52:17 +00:00
|
|
|
variable_ops), IIC_fpLoadm,
|
2009-10-27 00:20:49 +00:00
|
|
|
"fldm${addr:submode}d${p}\t${addr:base}, $wb",
|
2008-11-11 21:48:44 +00:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-10-01 01:33:39 +00:00
|
|
|
def FLDMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-21 20:52:17 +00:00
|
|
|
variable_ops), IIC_fpLoadm,
|
2009-10-27 00:20:49 +00:00
|
|
|
"fldm${addr:submode}s${p}\t${addr:base}, $wb",
|
2008-11-11 21:48:44 +00:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 1;
|
|
|
|
}
|
2009-10-01 08:22:27 +00:00
|
|
|
} // mayLoad, hasExtraDefRegAllocReq
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-10-01 08:22:27 +00:00
|
|
|
let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
|
2009-10-01 01:33:39 +00:00
|
|
|
def FSTMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-21 20:52:17 +00:00
|
|
|
variable_ops), IIC_fpStorem,
|
2009-10-27 00:20:49 +00:00
|
|
|
"fstm${addr:submode}d${p}\t${addr:base}, $wb",
|
2008-11-11 21:48:44 +00:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 0;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-10-01 01:33:39 +00:00
|
|
|
def FSTMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-21 20:52:17 +00:00
|
|
|
variable_ops), IIC_fpStorem,
|
2009-10-27 00:20:49 +00:00
|
|
|
"fstm${addr:submode}s${p}\t${addr:base}, $wb",
|
2008-11-11 21:48:44 +00:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 0;
|
|
|
|
}
|
2009-10-01 08:22:27 +00:00
|
|
|
} // mayStore, hasExtraSrcRegAllocReq
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
// FLDMX, FSTMX - mixing S/D registers for pre-armv6 cores
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Binary Operations.
|
|
|
|
//
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FADDD : ADbI<0b11100011, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpALU64, "faddd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fadd DPR:$a, DPR:$b))]>;
|
|
|
|
|
2009-08-04 17:53:06 +00:00
|
|
|
def FADDS : ASbIn<0b11100011, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpALU32, "fadds", "\t$dst, $a, $b",
|
2009-08-04 17:53:06 +00:00
|
|
|
[(set SPR:$dst, (fadd SPR:$a, SPR:$b))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-12 07:18:38 +00:00
|
|
|
// These are encoded as unary instructions.
|
2009-07-20 02:12:31 +00:00
|
|
|
let Defs = [FPSCR] in {
|
2008-11-12 07:18:38 +00:00
|
|
|
def FCMPED : ADuI<0b11101011, 0b0100, 0b1100, (outs), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCMP64, "fcmped", "\t$a, $b",
|
2008-11-12 07:18:38 +00:00
|
|
|
[(arm_cmpfp DPR:$a, DPR:$b)]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-12 07:18:38 +00:00
|
|
|
def FCMPES : ASuI<0b11101011, 0b0100, 0b1100, (outs), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCMP32, "fcmpes", "\t$a, $b",
|
2008-11-12 07:18:38 +00:00
|
|
|
[(arm_cmpfp SPR:$a, SPR:$b)]>;
|
2009-07-20 02:12:31 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FDIVD : ADbI<0b11101000, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpDIV64, "fdivd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fdiv DPR:$a, DPR:$b))]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FDIVS : ASbI<0b11101000, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpDIV32, "fdivs", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (fdiv SPR:$a, SPR:$b))]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FMULD : ADbI<0b11100010, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMUL64, "fmuld", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fmul DPR:$a, DPR:$b))]>;
|
|
|
|
|
2009-08-04 17:53:06 +00:00
|
|
|
def FMULS : ASbIn<0b11100010, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMUL32, "fmuls", "\t$dst, $a, $b",
|
2009-08-04 17:53:06 +00:00
|
|
|
[(set SPR:$dst, (fmul SPR:$a, SPR:$b))]>;
|
2007-05-03 00:32:00 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNMULD : ADbI<0b11100010, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMUL64, "fnmuld", "\t$dst, $a, $b",
|
2008-11-11 02:11:05 +00:00
|
|
|
[(set DPR:$dst, (fneg (fmul DPR:$a, DPR:$b)))]> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNMULS : ASbI<0b11100010, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMUL32, "fnmuls", "\t$dst, $a, $b",
|
2008-11-11 02:11:05 +00:00
|
|
|
[(set SPR:$dst, (fneg (fmul SPR:$a, SPR:$b)))]> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2007-05-03 00:32:00 +00:00
|
|
|
// Match reassociated forms only if not sign dependent rounding.
|
|
|
|
def : Pat<(fmul (fneg DPR:$a), DPR:$b),
|
|
|
|
(FNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
|
|
|
def : Pat<(fmul (fneg SPR:$a), SPR:$b),
|
|
|
|
(FNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
|
|
|
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FSUBD : ADbI<0b11100011, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpALU64, "fsubd", "\t$dst, $a, $b",
|
2008-11-13 07:59:48 +00:00
|
|
|
[(set DPR:$dst, (fsub DPR:$a, DPR:$b))]> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-04 17:53:06 +00:00
|
|
|
def FSUBS : ASbIn<0b11100011, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpALU32, "fsubs", "\t$dst, $a, $b",
|
2009-08-04 17:53:06 +00:00
|
|
|
[(set SPR:$dst, (fsub SPR:$a, SPR:$b))]> {
|
2008-11-13 07:59:48 +00:00
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Unary Operations.
|
|
|
|
//
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FABSD : ADuI<0b11101011, 0b0000, 0b1100, (outs DPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA64, "fabsd", "\t$dst, $a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fabs DPR:$a))]>;
|
|
|
|
|
2009-08-04 20:39:05 +00:00
|
|
|
def FABSS : ASuIn<0b11101011, 0b0000, 0b1100, (outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA32, "fabss", "\t$dst, $a",
|
2009-08-04 20:39:05 +00:00
|
|
|
[(set SPR:$dst, (fabs SPR:$a))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-07-20 02:12:31 +00:00
|
|
|
let Defs = [FPSCR] in {
|
2008-11-11 02:11:05 +00:00
|
|
|
def FCMPEZD : ADuI<0b11101011, 0b0101, 0b1100, (outs), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCMP64, "fcmpezd", "\t$a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(arm_cmpfp0 DPR:$a)]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FCMPEZS : ASuI<0b11101011, 0b0101, 0b1100, (outs), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCMP32, "fcmpezs", "\t$a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(arm_cmpfp0 SPR:$a)]>;
|
2009-07-20 02:12:31 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FCVTDS : ASuI<0b11101011, 0b0111, 0b1100, (outs DPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTDS, "fcvtds", "\t$dst, $a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fextend SPR:$a))]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
// Special case encoding: bits 11-8 is 0b1011.
|
2009-07-10 17:03:29 +00:00
|
|
|
def FCVTSD : VFPAI<(outs SPR:$dst), (ins DPR:$a), VFPUnaryFrm,
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTSD, "fcvtsd", "\t$dst, $a",
|
2009-07-10 17:03:29 +00:00
|
|
|
[(set SPR:$dst, (fround DPR:$a))]> {
|
2008-11-11 02:11:05 +00:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-16} = 0b110111;
|
|
|
|
let Inst{11-8} = 0b1011;
|
|
|
|
let Inst{7-4} = 0b1100;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-06-12 20:46:18 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
2008-11-11 02:11:05 +00:00
|
|
|
def FCPYD : ADuI<0b11101011, 0b0000, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA64, "fcpyd", "\t$dst, $a", []>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FCPYS : ASuI<0b11101011, 0b0000, 0b0100, (outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA32, "fcpys", "\t$dst, $a", []>;
|
2009-06-12 20:46:18 +00:00
|
|
|
} // neverHasSideEffects
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNEGD : ADuI<0b11101011, 0b0001, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA64, "fnegd", "\t$dst, $a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fneg DPR:$a))]>;
|
|
|
|
|
2009-08-04 20:39:05 +00:00
|
|
|
def FNEGS : ASuIn<0b11101011, 0b0001, 0b0100, (outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA32, "fnegs", "\t$dst, $a",
|
2009-08-04 20:39:05 +00:00
|
|
|
[(set SPR:$dst, (fneg SPR:$a))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FSQRTD : ADuI<0b11101011, 0b0001, 0b1100, (outs DPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpSQRT64, "fsqrtd", "\t$dst, $a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fsqrt DPR:$a))]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FSQRTS : ASuI<0b11101011, 0b0001, 0b1100, (outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpSQRT32, "fsqrts", "\t$dst, $a",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (fsqrt SPR:$a))]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP <-> GPR Copies. Int <-> FP Conversions.
|
|
|
|
//
|
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FMRS : AVConv2I<0b11100001, 0b1010, (outs GPR:$dst), (ins SPR:$src),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_VMOVSI, "fmrs", "\t$dst, $src",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set GPR:$dst, (bitconvert SPR:$src))]>;
|
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FMSR : AVConv4I<0b11100000, 0b1010, (outs SPR:$dst), (ins GPR:$src),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_VMOVIS, "fmsr", "\t$dst, $src",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (bitconvert GPR:$src))]>;
|
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FMRRD : AVConv3I<0b11000101, 0b1011,
|
2009-10-01 01:33:39 +00:00
|
|
|
(outs GPR:$wb, GPR:$dst2), (ins DPR:$src),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_VMOVDI, "fmrrd", "\t$wb, $dst2, $src",
|
2007-01-19 07:51:42 +00:00
|
|
|
[/* FIXME: Can't write pattern for multiple result instr*/]>;
|
|
|
|
|
|
|
|
// FMDHR: GPR -> SPR
|
|
|
|
// FMDLR: GPR -> SPR
|
|
|
|
|
2008-12-11 22:02:02 +00:00
|
|
|
def FMDRR : AVConv5I<0b11000100, 0b1011,
|
|
|
|
(outs DPR:$dst), (ins GPR:$src1, GPR:$src2),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_VMOVID, "fmdrr", "\t$dst, $src1, $src2",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (arm_fmdrr GPR:$src1, GPR:$src2))]>;
|
|
|
|
|
|
|
|
// FMRDH: SPR -> GPR
|
|
|
|
// FMRDL: SPR -> GPR
|
|
|
|
// FMRRS: SPR -> GPR
|
|
|
|
// FMRX : SPR system reg -> GPR
|
|
|
|
|
|
|
|
// FMSRR: GPR -> SPR
|
|
|
|
|
|
|
|
// FMXR: GPR -> VFP Sstem reg
|
|
|
|
|
|
|
|
|
|
|
|
// Int to FP:
|
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FSITOD : AVConv1I<0b11101011, 0b1000, 0b1011, (outs DPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTID, "fsitod", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set DPR:$dst, (arm_sitof SPR:$a))]> {
|
2008-11-15 00:40:57 +00:00
|
|
|
let Inst{7} = 1;
|
2008-11-11 19:40:26 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-10 22:17:39 +00:00
|
|
|
def FSITOS : AVConv1In<0b11101011, 0b1000, 0b1010, (outs SPR:$dst),(ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTIS, "fsitos", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set SPR:$dst, (arm_sitof SPR:$a))]> {
|
2008-11-15 00:40:57 +00:00
|
|
|
let Inst{7} = 1;
|
2008-11-11 19:40:26 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FUITOD : AVConv1I<0b11101011, 0b1000, 0b1011, (outs DPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTID, "fuitod", "\t$dst, $a",
|
2008-11-15 00:40:57 +00:00
|
|
|
[(set DPR:$dst, (arm_uitof SPR:$a))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-10 22:17:39 +00:00
|
|
|
def FUITOS : AVConv1In<0b11101011, 0b1000, 0b1010, (outs SPR:$dst),(ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTIS, "fuitos", "\t$dst, $a",
|
2008-11-15 00:40:57 +00:00
|
|
|
[(set SPR:$dst, (arm_uitof SPR:$a))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
// FP to Int:
|
|
|
|
// Always set Z bit in the instruction, i.e. "round towards zero" variants.
|
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FTOSIZD : AVConv1I<0b11101011, 0b1101, 0b1011,
|
2008-11-11 19:40:26 +00:00
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTDI, "ftosizd", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set SPR:$dst, (arm_ftosi DPR:$a))]> {
|
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-10 22:17:39 +00:00
|
|
|
def FTOSIZS : AVConv1In<0b11101011, 0b1101, 0b1010,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTSI, "ftosizs", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set SPR:$dst, (arm_ftosi SPR:$a))]> {
|
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-12 06:41:41 +00:00
|
|
|
def FTOUIZD : AVConv1I<0b11101011, 0b1100, 0b1011,
|
2008-11-11 19:40:26 +00:00
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTDI, "ftouizd", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set SPR:$dst, (arm_ftoui DPR:$a))]> {
|
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-10 22:17:39 +00:00
|
|
|
def FTOUIZS : AVConv1In<0b11101011, 0b1100, 0b1010,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpCVTSI, "ftouizs", "\t$dst, $a",
|
2008-11-11 19:40:26 +00:00
|
|
|
[(set SPR:$dst, (arm_ftoui SPR:$a))]> {
|
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP FMA Operations.
|
|
|
|
//
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FMACD : ADbI<0b11100000, (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC64, "fmacd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fadd (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
|
|
|
|
RegConstraint<"$dstin = $dst">;
|
|
|
|
|
2009-08-04 17:53:06 +00:00
|
|
|
def FMACS : ASbIn<0b11100000, (outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC32, "fmacs", "\t$dst, $a, $b",
|
2009-08-04 17:53:06 +00:00
|
|
|
[(set SPR:$dst, (fadd (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
|
|
|
|
RegConstraint<"$dstin = $dst">;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FMSCD : ADbI<0b11100001, (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC64, "fmscd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fsub (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
|
|
|
|
RegConstraint<"$dstin = $dst">;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FMSCS : ASbI<0b11100001, (outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC32, "fmscs", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (fsub (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
|
|
|
|
RegConstraint<"$dstin = $dst">;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNMACD : ADbI<0b11100000, (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC64, "fnmacd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fadd (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
|
2008-11-11 02:11:05 +00:00
|
|
|
RegConstraint<"$dstin = $dst"> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-04 17:53:06 +00:00
|
|
|
def FNMACS : ASbIn<0b11100000, (outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC32, "fnmacs", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (fadd (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
|
2008-11-11 02:11:05 +00:00
|
|
|
RegConstraint<"$dstin = $dst"> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-08-04 18:44:29 +00:00
|
|
|
def : Pat<(fsub DPR:$dstin, (fmul DPR:$a, DPR:$b)),
|
|
|
|
(FNMACD DPR:$dstin, DPR:$a, DPR:$b)>, Requires<[DontUseNEONForFP]>;
|
|
|
|
def : Pat<(fsub SPR:$dstin, (fmul SPR:$a, SPR:$b)),
|
|
|
|
(FNMACS SPR:$dstin, SPR:$a, SPR:$b)>, Requires<[DontUseNEONForFP]>;
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNMSCD : ADbI<0b11100001, (outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC64, "fnmscd", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
|
2008-11-11 02:11:05 +00:00
|
|
|
RegConstraint<"$dstin = $dst"> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
def FNMSCS : ASbI<0b11100001, (outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpMAC32, "fnmscs", "\t$dst, $a, $b",
|
2007-01-19 07:51:42 +00:00
|
|
|
[(set SPR:$dst, (fsub (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
|
2008-11-11 02:11:05 +00:00
|
|
|
RegConstraint<"$dstin = $dst"> {
|
|
|
|
let Inst{6} = 1;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Conditional moves.
|
|
|
|
//
|
|
|
|
|
2008-11-11 19:40:26 +00:00
|
|
|
def FCPYDcc : ADuI<0b11101011, 0b0000, 0b0100,
|
|
|
|
(outs DPR:$dst), (ins DPR:$false, DPR:$true),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA64, "fcpyd", "\t$dst, $true",
|
2007-07-05 07:13:32 +00:00
|
|
|
[/*(set DPR:$dst, (ARMcmov DPR:$false, DPR:$true, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$false = $dst">;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 19:40:26 +00:00
|
|
|
def FCPYScc : ASuI<0b11101011, 0b0000, 0b0100,
|
|
|
|
(outs SPR:$dst), (ins SPR:$false, SPR:$true),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA32, "fcpys", "\t$dst, $true",
|
2007-07-05 07:13:32 +00:00
|
|
|
[/*(set SPR:$dst, (ARMcmov SPR:$false, SPR:$true, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$false = $dst">;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 19:40:26 +00:00
|
|
|
def FNEGDcc : ADuI<0b11101011, 0b0001, 0b0100,
|
|
|
|
(outs DPR:$dst), (ins DPR:$false, DPR:$true),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA64, "fnegd", "\t$dst, $true",
|
2007-07-05 07:13:32 +00:00
|
|
|
[/*(set DPR:$dst, (ARMcneg DPR:$false, DPR:$true, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$false = $dst">;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 19:40:26 +00:00
|
|
|
def FNEGScc : ASuI<0b11101011, 0b0001, 0b0100,
|
|
|
|
(outs SPR:$dst), (ins SPR:$false, SPR:$true),
|
2009-10-27 00:20:49 +00:00
|
|
|
IIC_fpUNA32, "fnegs", "\t$dst, $true",
|
2007-07-05 07:13:32 +00:00
|
|
|
[/*(set SPR:$dst, (ARMcneg SPR:$false, SPR:$true, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$false = $dst">;
|
2008-11-11 19:40:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Misc.
|
|
|
|
//
|
|
|
|
|
2009-07-20 02:12:31 +00:00
|
|
|
let Defs = [CPSR], Uses = [FPSCR] in
|
2009-10-27 00:20:49 +00:00
|
|
|
def FMSTAT : VFPAI<(outs), (ins), VFPMiscFrm, IIC_fpSTAT, "fmstat", "",
|
|
|
|
[(arm_fmstat)]> {
|
2008-11-11 21:48:44 +00:00
|
|
|
let Inst{27-20} = 0b11101111;
|
|
|
|
let Inst{19-16} = 0b0001;
|
|
|
|
let Inst{15-12} = 0b1111;
|
|
|
|
let Inst{11-8} = 0b1010;
|
|
|
|
let Inst{7} = 0;
|
|
|
|
let Inst{4} = 1;
|
|
|
|
}
|