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