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>]>;
|
2009-11-09 08:11:35 +08:00
|
|
|
def SDT_VMOVDRR :
|
2007-01-19 15:51:42 +08:00
|
|
|
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]>;
|
2009-11-09 08:11:35 +08:00
|
|
|
def arm_fmdrr : SDNode<"ARMISD::VMOVDRR", SDT_VMOVDRR>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2009-10-28 09:44:26 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Operand Definitions.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
def vfp_f32imm : Operand<f32>,
|
|
|
|
PatLeaf<(f32 fpimm), [{
|
|
|
|
return ARM::getVFPf32Imm(N->getValueAPF()) != -1;
|
|
|
|
}]> {
|
|
|
|
let PrintMethod = "printVFPf32ImmOperand";
|
|
|
|
}
|
|
|
|
|
|
|
|
def vfp_f64imm : Operand<f64>,
|
|
|
|
PatLeaf<(f64 fpimm), [{
|
|
|
|
return ARM::getVFPf64Imm(N->getValueAPF()) != -1;
|
|
|
|
}]> {
|
|
|
|
let PrintMethod = "printVFPf64ImmOperand";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Load / store Instructions.
|
|
|
|
//
|
|
|
|
|
2010-02-28 07:47:46 +08:00
|
|
|
let canFoldAsLoad = 1, isReMaterializable = 1 in {
|
2009-11-09 08:11:35 +08:00
|
|
|
def VLDRD : ADI5<0b1101, 0b01, (outs DPR:$dst), (ins addrmode5:$addr),
|
|
|
|
IIC_fpLoad64, "vldr", ".64\t$dst, $addr",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (load addrmode5:$addr))]>;
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VLDRS : ASI5<0b1101, 0b01, (outs SPR:$dst), (ins addrmode5:$addr),
|
|
|
|
IIC_fpLoad32, "vldr", ".32\t$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
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VSTRD : ADI5<0b1101, 0b00, (outs), (ins DPR:$src, addrmode5:$addr),
|
|
|
|
IIC_fpStore64, "vstr", ".64\t$src, $addr",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(store DPR:$src, addrmode5:$addr)]>;
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VSTRS : ASI5<0b1101, 0b00, (outs), (ins SPR:$src, addrmode5:$addr),
|
|
|
|
IIC_fpStore32, "vstr", ".32\t$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-11-09 08:11:35 +08:00
|
|
|
def VLDMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-22 04:52:17 +08:00
|
|
|
variable_ops), IIC_fpLoadm,
|
2009-11-09 08:11:35 +08:00
|
|
|
"vldm${addr:submode}${p}\t${addr:base}, $wb",
|
2008-11-12 05:48:44 +08:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 1;
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VLDMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-22 04:52:17 +08:00
|
|
|
variable_ops), IIC_fpLoadm,
|
2009-11-09 08:11:35 +08:00
|
|
|
"vldm${addr:submode}${p}\t${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-11-09 08:11:35 +08:00
|
|
|
def VSTMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-22 04:52:17 +08:00
|
|
|
variable_ops), IIC_fpStorem,
|
2009-11-09 08:11:35 +08:00
|
|
|
"vstm${addr:submode}${p}\t${addr:base}, $wb",
|
2008-11-12 05:48:44 +08:00
|
|
|
[]> {
|
|
|
|
let Inst{20} = 0;
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VSTMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$wb,
|
2009-09-22 04:52:17 +08:00
|
|
|
variable_ops), IIC_fpStorem,
|
2009-11-09 08:11:35 +08:00
|
|
|
"vstm${addr:submode}${p}\t${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.
|
|
|
|
//
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VADDD : ADbI<0b11100, 0b11, 0, 0, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpALU64, "vadd", ".f64\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fadd DPR:$a, DPR:$b))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VADDS : ASbIn<0b11100, 0b11, 0, 0, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpALU32, "vadd", ".f32\t$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 {
|
2010-01-30 07:21:10 +08:00
|
|
|
def VCMPED : ADuI<0b11101, 0b11, 0b0100, 0b11, 0, (outs), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCMP64, "vcmpe", ".f64\t$a, $b",
|
2008-11-12 15:18:38 +08:00
|
|
|
[(arm_cmpfp DPR:$a, DPR:$b)]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-02-09 03:41:48 +08:00
|
|
|
def VCMPD : ADuI<0b11101, 0b11, 0b0100, 0b01, 0, (outs), (ins DPR:$a, DPR:$b),
|
|
|
|
IIC_fpCMP64, "vcmp", ".f64\t$a, $b",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VCMPES : ASuI<0b11101, 0b11, 0b0100, 0b11, 0, (outs), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCMP32, "vcmpe", ".f32\t$a, $b",
|
2008-11-12 15:18:38 +08:00
|
|
|
[(arm_cmpfp SPR:$a, SPR:$b)]>;
|
2010-02-09 03:41:48 +08:00
|
|
|
|
|
|
|
def VCMPS : ASuI<0b11101, 0b11, 0b0100, 0b01, 0, (outs), (ins SPR:$a, SPR:$b),
|
|
|
|
IIC_fpCMP32, "vcmp", ".f32\t$a, $b",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
2009-07-20 10:12:31 +08:00
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VDIVD : ADbI<0b11101, 0b00, 0, 0, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpDIV64, "vdiv", ".f64\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fdiv DPR:$a, DPR:$b))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VDIVS : ASbI<0b11101, 0b00, 0, 0, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpDIV32, "vdiv", ".f32\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set SPR:$dst, (fdiv SPR:$a, SPR:$b))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMULD : ADbI<0b11100, 0b10, 0, 0, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMUL64, "vmul", ".f64\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fmul DPR:$a, DPR:$b))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMULS : ASbIn<0b11100, 0b10, 0, 0, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMUL32, "vmul", ".f32\t$dst, $a, $b",
|
2009-08-05 01:53:06 +08:00
|
|
|
[(set SPR:$dst, (fmul SPR:$a, SPR:$b))]>;
|
2009-11-09 08:11:35 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMULD : ADbI<0b11100, 0b10, 1, 0, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMUL64, "vnmul", ".f64\t$dst, $a, $b",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set DPR:$dst, (fneg (fmul DPR:$a, DPR:$b)))]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMULS : ASbI<0b11100, 0b10, 1, 0, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMUL32, "vnmul", ".f32\t$dst, $a, $b",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set SPR:$dst, (fneg (fmul SPR:$a, SPR:$b)))]>;
|
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),
|
2009-11-09 08:11:35 +08:00
|
|
|
(VNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
2007-05-03 08:32:00 +08:00
|
|
|
def : Pat<(fmul (fneg SPR:$a), SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
(VNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
2007-05-03 08:32:00 +08:00
|
|
|
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSUBD : ADbI<0b11100, 0b11, 1, 0, (outs DPR:$dst), (ins DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpALU64, "vsub", ".f64\t$dst, $a, $b",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set DPR:$dst, (fsub DPR:$a, DPR:$b))]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSUBS : ASbIn<0b11100, 0b11, 1, 0, (outs SPR:$dst), (ins SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpALU32, "vsub", ".f32\t$dst, $a, $b",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set SPR:$dst, (fsub SPR:$a, SPR:$b))]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Unary Operations.
|
|
|
|
//
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VABSD : ADuI<0b11101, 0b11, 0b0000, 0b11, 0, (outs DPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA64, "vabs", ".f64\t$dst, $a",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fabs DPR:$a))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VABSS : ASuIn<0b11101, 0b11, 0b0000, 0b11, 0,(outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA32, "vabs", ".f32\t$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 {
|
2010-01-30 07:21:10 +08:00
|
|
|
def VCMPEZD : ADuI<0b11101, 0b11, 0b0101, 0b11, 0, (outs), (ins DPR:$a),
|
2009-11-09 23:27:51 +08:00
|
|
|
IIC_fpCMP64, "vcmpe", ".f64\t$a, #0",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(arm_cmpfp0 DPR:$a)]>;
|
|
|
|
|
2010-02-09 03:41:48 +08:00
|
|
|
def VCMPZD : ADuI<0b11101, 0b11, 0b0101, 0b01, 0, (outs), (ins DPR:$a),
|
|
|
|
IIC_fpCMP64, "vcmp", ".f64\t$a, #0",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VCMPEZS : ASuI<0b11101, 0b11, 0b0101, 0b11, 0, (outs), (ins SPR:$a),
|
2009-11-09 23:27:51 +08:00
|
|
|
IIC_fpCMP32, "vcmpe", ".f32\t$a, #0",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(arm_cmpfp0 SPR:$a)]>;
|
2010-02-09 03:41:48 +08:00
|
|
|
|
|
|
|
def VCMPZS : ASuI<0b11101, 0b11, 0b0101, 0b01, 0, (outs), (ins SPR:$a),
|
|
|
|
IIC_fpCMP32, "vcmp", ".f32\t$a, #0",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
2009-07-20 10:12:31 +08:00
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VCVTDS : ASuI<0b11101, 0b11, 0b0111, 0b11, 0, (outs DPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTDS, "vcvt", ".f64.f32\t$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-11-09 08:11:35 +08:00
|
|
|
def VCVTSD : VFPAI<(outs SPR:$dst), (ins DPR:$a), VFPUnaryFrm,
|
|
|
|
IIC_fpCVTSD, "vcvt", ".f32.f64\t$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;
|
2010-01-30 07:21:10 +08:00
|
|
|
let Inst{7-6} = 0b11;
|
|
|
|
let Inst{4} = 0;
|
2008-11-11 10:11:05 +08:00
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-02-10 01:21:56 +08:00
|
|
|
// Between half-precision and single-precision. For disassembly only.
|
|
|
|
|
|
|
|
def VCVTBSH : ASuI<0b11101, 0b11, 0b0010, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
|
|
|
|
/* FIXME */ IIC_fpCVTDS, "vcvtb", ".f32.f16\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VCVTBHS : ASuI<0b11101, 0b11, 0b0011, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
|
|
|
|
/* FIXME */ IIC_fpCVTDS, "vcvtb", ".f16.f32\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VCVTTSH : ASuI<0b11101, 0b11, 0b0010, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
|
|
|
|
/* FIXME */ IIC_fpCVTDS, "vcvtt", ".f32.f16\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VCVTTHS : ASuI<0b11101, 0b11, 0b0011, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
|
|
|
|
/* FIXME */ IIC_fpCVTDS, "vcvtt", ".f16.f32\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2009-06-13 04:46:18 +08:00
|
|
|
let neverHasSideEffects = 1 in {
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMOVD: ADuI<0b11101, 0b11, 0b0000, 0b01, 0, (outs DPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA64, "vmov", ".f64\t$dst, $a", []>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMOVS: ASuI<0b11101, 0b11, 0b0000, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA32, "vmov", ".f32\t$dst, $a", []>;
|
2009-06-13 04:46:18 +08:00
|
|
|
} // neverHasSideEffects
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNEGD : ADuI<0b11101, 0b11, 0b0001, 0b01, 0, (outs DPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA64, "vneg", ".f64\t$dst, $a",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fneg DPR:$a))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNEGS : ASuIn<0b11101, 0b11, 0b0001, 0b01, 0,(outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA32, "vneg", ".f32\t$dst, $a",
|
2009-08-05 04:39:05 +08:00
|
|
|
[(set SPR:$dst, (fneg SPR:$a))]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSQRTD : ADuI<0b11101, 0b11, 0b0001, 0b11, 0, (outs DPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpSQRT64, "vsqrt", ".f64\t$dst, $a",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fsqrt DPR:$a))]>;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSQRTS : ASuI<0b11101, 0b11, 0b0001, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpSQRT32, "vsqrt", ".f32\t$dst, $a",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set SPR:$dst, (fsqrt SPR:$a))]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP <-> GPR Copies. Int <-> FP Conversions.
|
|
|
|
//
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VMOVRS : AVConv2I<0b11100001, 0b1010, (outs GPR:$dst), (ins SPR:$src),
|
|
|
|
IIC_VMOVSI, "vmov", "\t$dst, $src",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set GPR:$dst, (bitconvert SPR:$src))]>;
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VMOVSR : AVConv4I<0b11100000, 0b1010, (outs SPR:$dst), (ins GPR:$src),
|
|
|
|
IIC_VMOVIS, "vmov", "\t$dst, $src",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set SPR:$dst, (bitconvert GPR:$src))]>;
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VMOVRRD : AVConv3I<0b11000101, 0b1011,
|
2009-10-01 09:33:39 +08:00
|
|
|
(outs GPR:$wb, GPR:$dst2), (ins DPR:$src),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_VMOVDI, "vmov", "\t$wb, $dst2, $src",
|
2010-02-06 02:04:58 +08:00
|
|
|
[/* FIXME: Can't write pattern for multiple result instr*/]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-02-09 01:26:09 +08:00
|
|
|
def VMOVRRS : AVConv3I<0b11000101, 0b1010,
|
|
|
|
(outs GPR:$wb, GPR:$dst2), (ins SPR:$src1, SPR:$src2),
|
|
|
|
IIC_VMOVDI, "vmov", "\t$wb, $dst2, $src1, $src2",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
// FMDHR: GPR -> SPR
|
|
|
|
// FMDLR: GPR -> SPR
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def VMOVDRR : AVConv5I<0b11000100, 0b1011,
|
2008-12-12 06:02:02 +08:00
|
|
|
(outs DPR:$dst), (ins GPR:$src1, GPR:$src2),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_VMOVID, "vmov", "\t$dst, $src1, $src2",
|
2010-02-06 02:04:58 +08:00
|
|
|
[(set DPR:$dst, (arm_fmdrr GPR:$src1, GPR:$src2))]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-02-09 01:26:09 +08:00
|
|
|
def VMOVSRR : AVConv5I<0b11000100, 0b1010,
|
|
|
|
(outs SPR:$dst1, SPR:$dst2), (ins GPR:$src1, GPR:$src2),
|
|
|
|
IIC_VMOVID, "vmov", "\t$dst1, $dst2, $src1, $src2",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
// 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:
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSITOD : AVConv1I<0b11101, 0b11, 0b1000, 0b1011,
|
|
|
|
(outs DPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTID, "vcvt", ".f64.s32\t$dst, $a",
|
2008-11-12 03:40:26 +08:00
|
|
|
[(set DPR:$dst, (arm_sitof SPR:$a))]> {
|
2010-01-30 07:21:10 +08:00
|
|
|
let Inst{7} = 1; // s32
|
2008-11-12 03:40:26 +08:00
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VSITOS : AVConv1In<0b11101, 0b11, 0b1000, 0b1010,
|
|
|
|
(outs SPR:$dst),(ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.s32\t$dst, $a",
|
2008-11-12 03:40:26 +08:00
|
|
|
[(set SPR:$dst, (arm_sitof SPR:$a))]> {
|
2010-01-30 07:21:10 +08:00
|
|
|
let Inst{7} = 1; // s32
|
2008-11-12 03:40:26 +08:00
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VUITOD : AVConv1I<0b11101, 0b11, 0b1000, 0b1011,
|
|
|
|
(outs DPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTID, "vcvt", ".f64.u32\t$dst, $a",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set DPR:$dst, (arm_uitof SPR:$a))]> {
|
|
|
|
let Inst{7} = 0; // u32
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VUITOS : AVConv1In<0b11101, 0b11, 0b1000, 0b1010,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.u32\t$dst, $a",
|
2010-01-30 07:21:10 +08:00
|
|
|
[(set SPR:$dst, (arm_uitof SPR:$a))]> {
|
|
|
|
let Inst{7} = 0; // u32
|
|
|
|
}
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// FP to Int:
|
|
|
|
// Always set Z bit in the instruction, i.e. "round towards zero" variants.
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VTOSIZD : AVConv1I<0b11101, 0b11, 0b1101, 0b1011,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTDI, "vcvt", ".s32.f64\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VTOSIZS : AVConv1In<0b11101, 0b11, 0b1101, 0b1010,
|
2009-08-11 06:17:39 +08:00
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTSI, "vcvt", ".s32.f32\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VTOUIZD : AVConv1I<0b11101, 0b11, 0b1100, 0b1011,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTDI, "vcvt", ".u32.f64\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VTOUIZS : AVConv1In<0b11101, 0b11, 0b1100, 0b1010,
|
2009-08-11 06:17:39 +08:00
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpCVTSI, "vcvt", ".u32.f32\t$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
|
|
|
|
2010-02-09 06:02:41 +08:00
|
|
|
// And the Z bit '0' variants, i.e. use the rounding mode specified by FPSCR.
|
|
|
|
// For disassembly only.
|
|
|
|
|
|
|
|
def VTOSIRD : AVConv1I<0b11101, 0b11, 0b1101, 0b1011,
|
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
|
|
|
IIC_fpCVTDI, "vcvtr", ".s32.f64\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
|
|
|
def VTOSIRS : AVConv1In<0b11101, 0b11, 0b1101, 0b1010,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
|
|
|
IIC_fpCVTSI, "vcvtr", ".s32.f32\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
|
|
|
def VTOUIRD : AVConv1I<0b11101, 0b11, 0b1100, 0b1011,
|
|
|
|
(outs SPR:$dst), (ins DPR:$a),
|
|
|
|
IIC_fpCVTDI, "vcvtr", ".u32.f64\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
|
|
|
def VTOUIRS : AVConv1In<0b11101, 0b11, 0b1100, 0b1010,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a),
|
|
|
|
IIC_fpCVTSI, "vcvtr", ".u32.f32\t$dst, $a",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
2010-02-12 02:17:16 +08:00
|
|
|
// Convert between floating-point and fixed-point
|
|
|
|
// Data type for fixed-point naming convention:
|
|
|
|
// S16 (U=0, sx=0) -> SH
|
|
|
|
// U16 (U=1, sx=0) -> UH
|
|
|
|
// S32 (U=0, sx=1) -> SL
|
|
|
|
// U32 (U=1, sx=1) -> UL
|
|
|
|
|
|
|
|
let Constraints = "$a = $dst" in {
|
|
|
|
|
|
|
|
// FP to Fixed-Point:
|
|
|
|
|
|
|
|
def VTOSHS : AVConv1XI<0b11101, 0b11, 0b1110, 0b1010, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".s16.f32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOUHS : AVConv1XI<0b11101, 0b11, 0b1111, 0b1010, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".u16.f32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOSLS : AVConv1XI<0b11101, 0b11, 0b1110, 0b1010, 1,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".s32.f32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOULS : AVConv1XI<0b11101, 0b11, 0b1111, 0b1010, 1,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".u32.f32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOSHD : AVConv1XI<0b11101, 0b11, 0b1110, 0b1011, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".s16.f64\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOUHD : AVConv1XI<0b11101, 0b11, 0b1111, 0b1011, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".u16.f64\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOSLD : AVConv1XI<0b11101, 0b11, 0b1110, 0b1011, 1,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".s32.f64\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VTOULD : AVConv1XI<0b11101, 0b11, 0b1111, 0b1011, 1,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".u32.f64\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
// Fixed-Point to FP:
|
|
|
|
|
|
|
|
def VSHTOS : AVConv1XI<0b11101, 0b11, 0b1010, 0b1010, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.s16\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VUHTOS : AVConv1XI<0b11101, 0b11, 0b1011, 0b1010, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.u16\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VSLTOS : AVConv1XI<0b11101, 0b11, 0b1010, 0b1010, 1,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.s32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VULTOS : AVConv1XI<0b11101, 0b11, 0b1011, 0b1010, 1,
|
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.u32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VSHTOD : AVConv1XI<0b11101, 0b11, 0b1010, 0b1011, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.s16\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VUHTOD : AVConv1XI<0b11101, 0b11, 0b1011, 0b1011, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.u16\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VSLTOD : AVConv1XI<0b11101, 0b11, 0b1010, 0b1011, 1,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.s32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
def VULTOD : AVConv1XI<0b11101, 0b11, 0b1011, 0b1011, 1,
|
|
|
|
(outs DPR:$dst), (ins DPR:$a, i32imm:$fbits),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.u32\t$dst, $a, $fbits",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
|
|
|
} // End of 'let Constraints = "$src = $dst" in'
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP FMA Operations.
|
|
|
|
//
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMLAD : ADbI<0b11100, 0b00, 0, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC64, "vmla", ".f64\t$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">;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMLAS : ASbIn<0b11100, 0b00, 0, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC32, "vmla", ".f32\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMLSD : ADbI<0b11100, 0b01, 0, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC64, "vnmls", ".f64\t$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">;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMLSS : ASbI<0b11100, 0b01, 0, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC32, "vnmls", ".f32\t$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">;
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMLSD : ADbI<0b11100, 0b00, 1, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC64, "vmls", ".f64\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fadd (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
|
2010-01-30 07:21:10 +08:00
|
|
|
RegConstraint<"$dstin = $dst">;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMLSS : ASbIn<0b11100, 0b00, 1, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC32, "vmls", ".f32\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set SPR:$dst, (fadd (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
|
2010-01-30 07:21:10 +08:00
|
|
|
RegConstraint<"$dstin = $dst">;
|
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)),
|
2009-11-09 08:11:35 +08:00
|
|
|
(VMLSD DPR:$dstin, DPR:$a, DPR:$b)>, Requires<[DontUseNEONForFP]>;
|
2009-08-05 02:44:29 +08:00
|
|
|
def : Pat<(fsub SPR:$dstin, (fmul SPR:$a, SPR:$b)),
|
2009-11-09 08:11:35 +08:00
|
|
|
(VMLSS SPR:$dstin, SPR:$a, SPR:$b)>, Requires<[DontUseNEONForFP]>;
|
2009-08-05 02:44:29 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMLAD : ADbI<0b11100, 0b01, 1, 0,
|
|
|
|
(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC64, "vnmla", ".f64\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
|
2010-01-30 07:21:10 +08:00
|
|
|
RegConstraint<"$dstin = $dst">;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNMLAS : ASbI<0b11100, 0b01, 1, 0,
|
|
|
|
(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpMAC32, "vnmla", ".f32\t$dst, $a, $b",
|
2007-01-19 15:51:42 +08:00
|
|
|
[(set SPR:$dst, (fsub (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
|
2010-01-30 07:21:10 +08:00
|
|
|
RegConstraint<"$dstin = $dst">;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Conditional moves.
|
|
|
|
//
|
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMOVDcc : ADuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs DPR:$dst), (ins DPR:$false, DPR:$true),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA64, "vmov", ".f64\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VMOVScc : ASuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs SPR:$dst), (ins SPR:$false, SPR:$true),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA32, "vmov", ".f32\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNEGDcc : ADuI<0b11101, 0b11, 0b0001, 0b01, 0,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs DPR:$dst), (ins DPR:$false, DPR:$true),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA64, "vneg", ".f64\t$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
|
|
|
|
2010-01-30 07:21:10 +08:00
|
|
|
def VNEGScc : ASuI<0b11101, 0b11, 0b0001, 0b01, 0,
|
2008-11-12 03:40:26 +08:00
|
|
|
(outs SPR:$dst), (ins SPR:$false, SPR:$true),
|
2009-11-09 08:11:35 +08:00
|
|
|
IIC_fpUNA32, "vneg", ".f32\t$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-11-11 03:44:56 +08:00
|
|
|
// APSR is the application level alias of CPSR. This FPSCR N, Z, C, V flags
|
|
|
|
// to APSR.
|
2009-07-20 10:12:31 +08:00
|
|
|
let Defs = [CPSR], Uses = [FPSCR] in
|
2009-11-09 08:11:35 +08:00
|
|
|
def FMSTAT : VFPAI<(outs), (ins), VFPMiscFrm, IIC_fpSTAT, "vmrs",
|
2009-11-13 09:17:22 +08:00
|
|
|
"\tapsr_nzcv, fpscr",
|
2009-10-27 08:20:49 +08:00
|
|
|
[(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;
|
|
|
|
}
|
2009-10-28 09:44:26 +08:00
|
|
|
|
2010-02-10 06:35:38 +08:00
|
|
|
// FPSCR <-> GPR (for disassembly only)
|
|
|
|
|
|
|
|
let Uses = [FPSCR] in {
|
|
|
|
def VMRS : VFPAI<(outs GPR:$dst), (ins), VFPMiscFrm, IIC_fpSTAT, "vmrs",
|
|
|
|
"\t$dst, fpscr",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{27-20} = 0b11101111;
|
|
|
|
let Inst{19-16} = 0b0001;
|
|
|
|
let Inst{11-8} = 0b1010;
|
|
|
|
let Inst{7} = 0;
|
|
|
|
let Inst{4} = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let Defs = [FPSCR] in {
|
|
|
|
def VMSR : VFPAI<(outs), (ins GPR:$src), VFPMiscFrm, IIC_fpSTAT, "vmsr",
|
|
|
|
"\tfpscr, $src",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{27-20} = 0b11101110;
|
|
|
|
let Inst{19-16} = 0b0001;
|
|
|
|
let Inst{11-8} = 0b1010;
|
|
|
|
let Inst{7} = 0;
|
|
|
|
let Inst{4} = 1;
|
|
|
|
}
|
|
|
|
}
|
2009-10-28 09:44:26 +08:00
|
|
|
|
|
|
|
// Materialize FP immediates. VFP3 only.
|
2009-11-09 08:11:35 +08:00
|
|
|
let isReMaterializable = 1 in {
|
|
|
|
def FCONSTD : VFPAI<(outs DPR:$dst), (ins vfp_f64imm:$imm),
|
2009-10-28 09:44:26 +08:00
|
|
|
VFPMiscFrm, IIC_VMOVImm,
|
2009-11-24 09:05:23 +08:00
|
|
|
"vmov", ".f64\t$dst, $imm",
|
2009-11-09 08:11:35 +08:00
|
|
|
[(set DPR:$dst, vfp_f64imm:$imm)]>, Requires<[HasVFP3]> {
|
2009-10-28 09:44:26 +08:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-20} = 0b11;
|
|
|
|
let Inst{11-9} = 0b101;
|
2009-11-09 08:11:35 +08:00
|
|
|
let Inst{8} = 1;
|
2009-10-28 09:44:26 +08:00
|
|
|
let Inst{7-4} = 0b0000;
|
|
|
|
}
|
|
|
|
|
2009-11-09 08:11:35 +08:00
|
|
|
def FCONSTS : VFPAI<(outs SPR:$dst), (ins vfp_f32imm:$imm),
|
2009-10-28 09:44:26 +08:00
|
|
|
VFPMiscFrm, IIC_VMOVImm,
|
2009-11-24 09:05:23 +08:00
|
|
|
"vmov", ".f32\t$dst, $imm",
|
2009-11-09 08:11:35 +08:00
|
|
|
[(set SPR:$dst, vfp_f32imm:$imm)]>, Requires<[HasVFP3]> {
|
2009-10-28 09:44:26 +08:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-20} = 0b11;
|
|
|
|
let Inst{11-9} = 0b101;
|
2009-11-09 08:11:35 +08:00
|
|
|
let Inst{8} = 0;
|
2009-10-28 09:44:26 +08:00
|
|
|
let Inst{7-4} = 0b0000;
|
|
|
|
}
|
2009-11-09 08:11:35 +08:00
|
|
|
}
|