2010-10-15 21:50:45 +00:00
|
|
|
//===- ARMInstrVFP.td - VFP support for ARM ----------------*- tablegen -*-===//
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-10-15 21:50:45 +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_VMOVDRR : SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisVT<1, i32>,
|
|
|
|
SDTCisSameAs<1, 2>]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-15 21:50:45 +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>;
|
|
|
|
def arm_fmstat : SDNode<"ARMISD::FMSTAT", SDTNone, [SDNPInFlag, SDNPOutFlag]>;
|
|
|
|
def arm_cmpfp : SDNode<"ARMISD::CMPFP", SDT_ARMCmp, [SDNPOutFlag]>;
|
|
|
|
def arm_cmpfp0 : SDNode<"ARMISD::CMPFPw0", SDT_CMPFP0, [SDNPOutFlag]>;
|
|
|
|
def arm_fmdrr : SDNode<"ARMISD::VMOVDRR", SDT_VMOVDRR>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2009-10-28 01:44:26 +00: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 07:51:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Load / store Instructions.
|
|
|
|
//
|
|
|
|
|
2010-02-27 23:47:46 +00:00
|
|
|
let canFoldAsLoad = 1, isReMaterializable = 1 in {
|
2010-11-03 01:49:29 +00:00
|
|
|
|
2010-10-20 22:44:54 +00:00
|
|
|
def VLDRD : ADI5<0b1101, 0b01, (outs DPR:$Dd), (ins addrmode5:$addr),
|
|
|
|
IIC_fpLoad64, "vldr", ".64\t$Dd, $addr",
|
2010-11-04 00:59:42 +00:00
|
|
|
[(set DPR:$Dd, (f64 (load addrmode5:$addr)))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-03 01:49:29 +00:00
|
|
|
def VLDRS : ASI5<0b1101, 0b01, (outs SPR:$Sd), (ins addrmode5:$addr),
|
|
|
|
IIC_fpLoad32, "vldr", ".32\t$Sd, $addr",
|
2010-11-04 00:59:42 +00:00
|
|
|
[(set SPR:$Sd, (load addrmode5:$addr))]>;
|
2010-11-03 01:49:29 +00:00
|
|
|
|
|
|
|
} // End of 'let canFoldAsLoad = 1, isReMaterializable = 1 in'
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-04 00:59:42 +00:00
|
|
|
def VSTRD : ADI5<0b1101, 0b00, (outs), (ins DPR:$Dd, addrmode5:$addr),
|
|
|
|
IIC_fpStore64, "vstr", ".64\t$Dd, $addr",
|
|
|
|
[(store (f64 DPR:$Dd), addrmode5:$addr)]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-04 00:59:42 +00:00
|
|
|
def VSTRS : ASI5<0b1101, 0b00, (outs), (ins SPR:$Sd, addrmode5:$addr),
|
|
|
|
IIC_fpStore32, "vstr", ".32\t$Sd, $addr",
|
|
|
|
[(store SPR:$Sd, addrmode5:$addr)]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Load / store multiple Instructions.
|
|
|
|
//
|
|
|
|
|
2010-11-16 01:16:36 +00:00
|
|
|
multiclass vfp_ldst_mult<string asm, bit L_bit,
|
|
|
|
InstrItinClass itin, InstrItinClass itin_upd> {
|
|
|
|
// Double Precision
|
|
|
|
def DIA :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXDI4<(outs), (ins GPR:$Rn, pred:$p, dpr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeNone, itin,
|
2010-11-16 01:16:36 +00:00
|
|
|
!strconcat(asm, "ia${p}\t$Rn, $regs"), "", []> {
|
2010-11-13 09:09:38 +00:00
|
|
|
let Inst{24-23} = 0b01; // Increment After
|
|
|
|
let Inst{21} = 0; // No writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def DIA_UPD :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXDI4<(outs GPR:$wb), (ins GPR:$Rn, pred:$p, dpr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeUpd, itin_upd,
|
2010-11-16 01:16:36 +00:00
|
|
|
!strconcat(asm, "ia${p}\t$Rn!, $regs"), "$Rn = $wb", []> {
|
2010-11-13 09:09:38 +00:00
|
|
|
let Inst{24-23} = 0b01; // Increment After
|
|
|
|
let Inst{21} = 1; // Writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def DDB :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXDI4<(outs), (ins GPR:$Rn, pred:$p, dpr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeNone, itin,
|
|
|
|
!strconcat(asm, "db${p}\t$Rn, $regs"), "", []> {
|
|
|
|
let Inst{24-23} = 0b10; // Decrement Before
|
|
|
|
let Inst{21} = 0; // No writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def DDB_UPD :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXDI4<(outs GPR:$wb), (ins GPR:$Rn, pred:$p, dpr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeUpd, itin_upd,
|
|
|
|
!strconcat(asm, "db${p}\t$Rn!, $regs"), "$Rn = $wb", []> {
|
|
|
|
let Inst{24-23} = 0b10; // Decrement Before
|
|
|
|
let Inst{21} = 1; // Writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
|
|
|
|
2010-11-16 01:16:36 +00:00
|
|
|
// Single Precision
|
|
|
|
def SIA :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXSI4<(outs), (ins GPR:$Rn, pred:$p, spr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeNone, itin,
|
2010-11-16 01:16:36 +00:00
|
|
|
!strconcat(asm, "ia${p}\t$Rn, $regs"), "", []> {
|
2010-11-13 09:09:38 +00:00
|
|
|
let Inst{24-23} = 0b01; // Increment After
|
|
|
|
let Inst{21} = 0; // No writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def SIA_UPD :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXSI4<(outs GPR:$wb), (ins GPR:$Rn, pred:$p, spr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeUpd, itin_upd,
|
2010-11-16 01:16:36 +00:00
|
|
|
!strconcat(asm, "ia${p}\t$Rn!, $regs"), "$Rn = $wb", []> {
|
2010-11-13 09:09:38 +00:00
|
|
|
let Inst{24-23} = 0b01; // Increment After
|
|
|
|
let Inst{21} = 1; // Writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def SDB :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXSI4<(outs), (ins GPR:$Rn, pred:$p, spr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeNone, itin,
|
|
|
|
!strconcat(asm, "db${p}\t$Rn, $regs"), "", []> {
|
|
|
|
let Inst{24-23} = 0b10; // Decrement Before
|
|
|
|
let Inst{21} = 0; // No writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
2010-11-16 01:16:36 +00:00
|
|
|
def SDB_UPD :
|
2010-11-17 04:32:08 +00:00
|
|
|
AXSI4<(outs GPR:$wb), (ins GPR:$Rn, pred:$p, spr_reglist:$regs, variable_ops),
|
2010-11-13 09:09:38 +00:00
|
|
|
IndexModeUpd, itin_upd,
|
|
|
|
!strconcat(asm, "db${p}\t$Rn!, $regs"), "$Rn = $wb", []> {
|
|
|
|
let Inst{24-23} = 0b10; // Decrement Before
|
|
|
|
let Inst{21} = 1; // Writeback
|
|
|
|
let Inst{20} = L_bit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-13 10:57:02 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
|
|
|
|
2010-11-16 01:16:36 +00:00
|
|
|
let mayLoad = 1, hasExtraDefRegAllocReq = 1 in
|
|
|
|
defm VLDM : vfp_ldst_mult<"vldm", 1, IIC_fpLoad_m, IIC_fpLoad_mu>;
|
2010-11-13 10:57:02 +00:00
|
|
|
|
2010-11-16 01:16:36 +00:00
|
|
|
let mayStore = 1, hasExtraSrcRegAllocReq = 1 in
|
|
|
|
defm VSTM : vfp_ldst_mult<"vstm", 0, IIC_fpLoad_m, IIC_fpLoad_mu>;
|
2010-11-13 10:57:02 +00:00
|
|
|
|
|
|
|
} // neverHasSideEffects
|
|
|
|
|
2010-11-16 02:00:24 +00:00
|
|
|
def : MnemonicAlias<"vldm", "vldmia">;
|
|
|
|
def : MnemonicAlias<"vstm", "vstmia">;
|
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
// FLDMX, FSTMX - mixing S/D registers for pre-armv6 cores
|
|
|
|
|
2010-10-12 23:06:54 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Binary Operations.
|
|
|
|
//
|
2010-02-08 19:41:48 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VADDD : ADbI<0b11100, 0b11, 0, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpALU64, "vadd", ".f64\t$Dd, $Dn, $Dm",
|
|
|
|
[(set DPR:$Dd, (fadd DPR:$Dn, (f64 DPR:$Dm)))]>;
|
|
|
|
|
|
|
|
def VADDS : ASbIn<0b11100, 0b11, 0, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpALU32, "vadd", ".f32\t$Sd, $Sn, $Sm",
|
|
|
|
[(set SPR:$Sd, (fadd SPR:$Sn, SPR:$Sm))]>;
|
|
|
|
|
|
|
|
def VSUBD : ADbI<0b11100, 0b11, 1, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpALU64, "vsub", ".f64\t$Dd, $Dn, $Dm",
|
|
|
|
[(set DPR:$Dd, (fsub DPR:$Dn, (f64 DPR:$Dm)))]>;
|
|
|
|
|
|
|
|
def VSUBS : ASbIn<0b11100, 0b11, 1, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpALU32, "vsub", ".f32\t$Sd, $Sn, $Sm",
|
|
|
|
[(set SPR:$Sd, (fsub SPR:$Sn, SPR:$Sm))]>;
|
|
|
|
|
|
|
|
def VDIVD : ADbI<0b11101, 0b00, 0, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpDIV64, "vdiv", ".f64\t$Dd, $Dn, $Dm",
|
|
|
|
[(set DPR:$Dd, (fdiv DPR:$Dn, (f64 DPR:$Dm)))]>;
|
|
|
|
|
|
|
|
def VDIVS : ASbI<0b11101, 0b00, 0, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpDIV32, "vdiv", ".f32\t$Sd, $Sn, $Sm",
|
|
|
|
[(set SPR:$Sd, (fdiv SPR:$Sn, SPR:$Sm))]>;
|
|
|
|
|
|
|
|
def VMULD : ADbI<0b11100, 0b10, 0, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMUL64, "vmul", ".f64\t$Dd, $Dn, $Dm",
|
|
|
|
[(set DPR:$Dd, (fmul DPR:$Dn, (f64 DPR:$Dm)))]>;
|
|
|
|
|
|
|
|
def VMULS : ASbIn<0b11100, 0b10, 0, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMUL32, "vmul", ".f32\t$Sd, $Sn, $Sm",
|
|
|
|
[(set SPR:$Sd, (fmul SPR:$Sn, SPR:$Sm))]>;
|
|
|
|
|
|
|
|
def VNMULD : ADbI<0b11100, 0b10, 1, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMUL64, "vnmul", ".f64\t$Dd, $Dn, $Dm",
|
|
|
|
[(set DPR:$Dd, (fneg (fmul DPR:$Dn, (f64 DPR:$Dm))))]>;
|
|
|
|
|
|
|
|
def VNMULS : ASbI<0b11100, 0b10, 1, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMUL32, "vnmul", ".f32\t$Sd, $Sn, $Sm",
|
|
|
|
[(set SPR:$Sd, (fneg (fmul SPR:$Sn, SPR:$Sm)))]>;
|
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.
|
2010-03-08 18:51:21 +00:00
|
|
|
def : Pat<(fmul (fneg DPR:$a), (f64 DPR:$b)),
|
2009-11-09 00:11:35 +00:00
|
|
|
(VNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
2007-05-03 00:32:00 +00:00
|
|
|
def : Pat<(fmul (fneg SPR:$a), SPR:$b),
|
2009-11-09 00:11:35 +00:00
|
|
|
(VNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
|
2007-05-03 00:32:00 +00:00
|
|
|
|
2010-10-12 22:55:35 +00:00
|
|
|
// These are encoded as unary instructions.
|
|
|
|
let Defs = [FPSCR] in {
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPED : ADuI<0b11101, 0b11, 0b0100, 0b11, 0,
|
|
|
|
(outs), (ins DPR:$Dd, DPR:$Dm),
|
|
|
|
IIC_fpCMP64, "vcmpe", ".f64\t$Dd, $Dm",
|
|
|
|
[(arm_cmpfp DPR:$Dd, (f64 DPR:$Dm))]>;
|
2010-10-13 00:04:29 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPES : ASuI<0b11101, 0b11, 0b0100, 0b11, 0,
|
|
|
|
(outs), (ins SPR:$Sd, SPR:$Sm),
|
|
|
|
IIC_fpCMP32, "vcmpe", ".f32\t$Sd, $Sm",
|
|
|
|
[(arm_cmpfp SPR:$Sd, SPR:$Sm)]>;
|
2010-10-12 22:55:35 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// FIXME: Verify encoding after integrated assembler is working.
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPD : ADuI<0b11101, 0b11, 0b0100, 0b01, 0,
|
|
|
|
(outs), (ins DPR:$Dd, DPR:$Dm),
|
|
|
|
IIC_fpCMP64, "vcmp", ".f64\t$Dd, $Dm",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
2010-10-12 22:55:35 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPS : ASuI<0b11101, 0b11, 0b0100, 0b01, 0,
|
|
|
|
(outs), (ins SPR:$Sd, SPR:$Sm),
|
|
|
|
IIC_fpCMP32, "vcmp", ".f32\t$Sd, $Sm",
|
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
2010-10-12 22:55:35 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Unary Operations.
|
|
|
|
//
|
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VABSD : ADuI<0b11101, 0b11, 0b0000, 0b11, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dm),
|
|
|
|
IIC_fpUNA64, "vabs", ".f64\t$Dd, $Dm",
|
|
|
|
[(set DPR:$Dd, (fabs (f64 DPR:$Dm)))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VABSS : ASuIn<0b11101, 0b11, 0b0000, 0b11, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpUNA32, "vabs", ".f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (fabs SPR:$Sm))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2009-07-20 02:12:31 +00:00
|
|
|
let Defs = [FPSCR] in {
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPEZD : ADuI<0b11101, 0b11, 0b0101, 0b11, 0,
|
|
|
|
(outs), (ins DPR:$Dd),
|
|
|
|
IIC_fpCMP64, "vcmpe", ".f64\t$Dd, #0",
|
|
|
|
[(arm_cmpfp0 (f64 DPR:$Dd))]> {
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
let Inst{5} = 0;
|
2010-10-13 00:38:07 +00:00
|
|
|
}
|
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPEZS : ASuI<0b11101, 0b11, 0b0101, 0b11, 0,
|
|
|
|
(outs), (ins SPR:$Sd),
|
|
|
|
IIC_fpCMP32, "vcmpe", ".f32\t$Sd, #0",
|
|
|
|
[(arm_cmpfp0 SPR:$Sd)]> {
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
let Inst{5} = 0;
|
2010-10-13 00:38:07 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// FIXME: Verify encoding after integrated assembler is working.
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPZD : ADuI<0b11101, 0b11, 0b0101, 0b01, 0,
|
|
|
|
(outs), (ins DPR:$Dd),
|
|
|
|
IIC_fpCMP64, "vcmp", ".f64\t$Dd, #0",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
let Inst{5} = 0;
|
2010-10-13 20:58:46 +00:00
|
|
|
}
|
2010-02-08 19:41:48 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VCMPZS : ASuI<0b11101, 0b11, 0b0101, 0b01, 0,
|
|
|
|
(outs), (ins SPR:$Sd),
|
|
|
|
IIC_fpCMP32, "vcmp", ".f32\t$Sd, #0",
|
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
let Inst{5} = 0;
|
2010-10-13 20:58:46 +00:00
|
|
|
}
|
2009-07-20 02:12:31 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 00:56:35 +00:00
|
|
|
def VCVTDS : ASuI<0b11101, 0b11, 0b0111, 0b11, 0,
|
|
|
|
(outs DPR:$Dd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTDS, "vcvt", ".f64.f32\t$Dd, $Sm",
|
|
|
|
[(set DPR:$Dd, (fextend SPR:$Sm))]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Dd;
|
|
|
|
bits<5> Sm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Sm{4-1};
|
|
|
|
let Inst{5} = Sm{0};
|
|
|
|
let Inst{15-12} = Dd{3-0};
|
|
|
|
let Inst{22} = Dd{4};
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
// Special case encoding: bits 11-8 is 0b1011.
|
2010-10-13 00:56:35 +00:00
|
|
|
def VCVTSD : VFPAI<(outs SPR:$Sd), (ins DPR:$Dm), VFPUnaryFrm,
|
|
|
|
IIC_fpCVTSD, "vcvt", ".f32.f64\t$Sd, $Dm",
|
|
|
|
[(set SPR:$Sd, (fround DPR:$Dm))]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sd;
|
|
|
|
bits<5> Dm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Dm{3-0};
|
|
|
|
let Inst{5} = Dm{4};
|
|
|
|
let Inst{15-12} = Sd{4-1};
|
|
|
|
let Inst{22} = Sd{0};
|
|
|
|
|
2008-11-11 02:11:05 +00:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-16} = 0b110111;
|
|
|
|
let Inst{11-8} = 0b1011;
|
2010-01-29 23:21:10 +00:00
|
|
|
let Inst{7-6} = 0b11;
|
|
|
|
let Inst{4} = 0;
|
2008-11-11 02:11:05 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-02-09 17:21:56 +00:00
|
|
|
// Between half-precision and single-precision. For disassembly only.
|
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// FIXME: Verify encoding after integrated assembler is working.
|
2010-06-02 21:53:11 +00:00
|
|
|
def VCVTBSH: ASuI<0b11101, 0b11, 0b0010, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
|
2010-04-07 18:19:46 +00:00
|
|
|
/* FIXME */ IIC_fpCVTSH, "vcvtb", ".f32.f16\t$dst, $a",
|
2010-03-18 22:35:37 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-03-19 22:51:32 +00:00
|
|
|
def : ARMPat<(f32_to_f16 SPR:$a),
|
|
|
|
(i32 (COPY_TO_REGCLASS (VCVTBSH SPR:$a), GPR))>;
|
2010-02-09 17:21:56 +00:00
|
|
|
|
2010-06-02 21:53:11 +00:00
|
|
|
def VCVTBHS: ASuI<0b11101, 0b11, 0b0011, 0b01, 0, (outs SPR:$dst), (ins SPR:$a),
|
2010-04-07 18:19:46 +00:00
|
|
|
/* FIXME */ IIC_fpCVTHS, "vcvtb", ".f16.f32\t$dst, $a",
|
2010-03-18 22:35:37 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-03-19 22:51:32 +00:00
|
|
|
def : ARMPat<(f16_to_f32 GPR:$a),
|
|
|
|
(VCVTBHS (COPY_TO_REGCLASS GPR:$a, SPR))>;
|
2010-02-09 17:21:56 +00:00
|
|
|
|
2010-06-02 21:53:11 +00:00
|
|
|
def VCVTTSH: ASuI<0b11101, 0b11, 0b0010, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
|
2010-04-07 18:19:46 +00:00
|
|
|
/* FIXME */ IIC_fpCVTSH, "vcvtt", ".f32.f16\t$dst, $a",
|
2010-02-09 17:21:56 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-06-02 21:53:11 +00:00
|
|
|
def VCVTTHS: ASuI<0b11101, 0b11, 0b0011, 0b11, 0, (outs SPR:$dst), (ins SPR:$a),
|
2010-04-07 18:19:46 +00:00
|
|
|
/* FIXME */ IIC_fpCVTHS, "vcvtt", ".f16.f32\t$dst, $a",
|
2010-02-09 17:21:56 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]>;
|
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VNEGD : ADuI<0b11101, 0b11, 0b0001, 0b01, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dm),
|
|
|
|
IIC_fpUNA64, "vneg", ".f64\t$Dd, $Dm",
|
|
|
|
[(set DPR:$Dd, (fneg (f64 DPR:$Dm)))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VNEGS : ASuIn<0b11101, 0b11, 0b0001, 0b01, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpUNA32, "vneg", ".f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (fneg SPR:$Sm))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VSQRTD : ADuI<0b11101, 0b11, 0b0001, 0b11, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dm),
|
|
|
|
IIC_fpSQRT64, "vsqrt", ".f64\t$Dd, $Dm",
|
|
|
|
[(set DPR:$Dd, (fsqrt (f64 DPR:$Dm)))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VSQRTS : ASuI<0b11101, 0b11, 0b0001, 0b11, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpSQRT32, "vsqrt", ".f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (fsqrt SPR:$Sm))]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
2010-11-01 06:00:39 +00:00
|
|
|
def VMOVD : ADuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dm),
|
|
|
|
IIC_fpUNA64, "vmov", ".f64\t$Dd, $Dm", []>;
|
2010-10-13 20:58:46 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VMOVS : ASuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpUNA32, "vmov", ".f32\t$Sd, $Sm", []>;
|
2010-10-13 20:58:46 +00:00
|
|
|
} // neverHasSideEffects
|
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP <-> GPR Copies. Int <-> FP Conversions.
|
|
|
|
//
|
|
|
|
|
2010-10-20 22:44:54 +00:00
|
|
|
def VMOVRS : AVConv2I<0b11100001, 0b1010,
|
|
|
|
(outs GPR:$Rt), (ins SPR:$Sn),
|
|
|
|
IIC_fpMOVSI, "vmov", "\t$Rt, $Sn",
|
|
|
|
[(set GPR:$Rt, (bitconvert SPR:$Sn))]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<4> Rt;
|
|
|
|
bits<5> Sn;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{19-16} = Sn{4-1};
|
|
|
|
let Inst{7} = Sn{0};
|
|
|
|
let Inst{15-12} = Rt;
|
|
|
|
|
|
|
|
let Inst{6-5} = 0b00;
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-20 22:44:54 +00:00
|
|
|
def VMOVSR : AVConv4I<0b11100000, 0b1010,
|
|
|
|
(outs SPR:$Sn), (ins GPR:$Rt),
|
|
|
|
IIC_fpMOVIS, "vmov", "\t$Sn, $Rt",
|
|
|
|
[(set SPR:$Sn, (bitconvert GPR:$Rt))]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sn;
|
|
|
|
bits<4> Rt;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{19-16} = Sn{4-1};
|
|
|
|
let Inst{7} = Sn{0};
|
|
|
|
let Inst{15-12} = Rt;
|
|
|
|
|
|
|
|
let Inst{6-5} = 0b00;
|
|
|
|
let Inst{3-0} = 0b0000;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-05-13 00:16:46 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
2009-11-09 00:11:35 +00:00
|
|
|
def VMOVRRD : AVConv3I<0b11000101, 0b1011,
|
2010-10-20 23:37:40 +00:00
|
|
|
(outs GPR:$Rt, GPR:$Rt2), (ins DPR:$Dm),
|
|
|
|
IIC_fpMOVDI, "vmov", "\t$Rt, $Rt2, $Dm",
|
2010-02-05 18:04:58 +00:00
|
|
|
[/* FIXME: Can't write pattern for multiple result instr*/]> {
|
2010-10-20 23:37:40 +00:00
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Dm;
|
|
|
|
bits<4> Rt;
|
|
|
|
bits<4> Rt2;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Dm{3-0};
|
|
|
|
let Inst{5} = Dm{4};
|
|
|
|
let Inst{15-12} = Rt;
|
|
|
|
let Inst{19-16} = Rt2;
|
|
|
|
|
2010-02-05 18:04:58 +00:00
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-02-08 17:26:09 +00:00
|
|
|
def VMOVRRS : AVConv3I<0b11000101, 0b1010,
|
|
|
|
(outs GPR:$wb, GPR:$dst2), (ins SPR:$src1, SPR:$src2),
|
2010-04-07 18:20:02 +00:00
|
|
|
IIC_fpMOVDI, "vmov", "\t$wb, $dst2, $src1, $src2",
|
2010-02-08 17:26:09 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
2010-05-13 00:16:46 +00:00
|
|
|
} // neverHasSideEffects
|
2010-02-08 17:26:09 +00:00
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
// FMDHR: GPR -> SPR
|
|
|
|
// FMDLR: GPR -> SPR
|
|
|
|
|
2009-11-09 00:11:35 +00:00
|
|
|
def VMOVDRR : AVConv5I<0b11000100, 0b1011,
|
2010-10-20 23:37:40 +00:00
|
|
|
(outs DPR:$Dm), (ins GPR:$Rt, GPR:$Rt2),
|
|
|
|
IIC_fpMOVID, "vmov", "\t$Dm, $Rt, $Rt2",
|
|
|
|
[(set DPR:$Dm, (arm_fmdrr GPR:$Rt, GPR:$Rt2))]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Dm;
|
|
|
|
bits<4> Rt;
|
|
|
|
bits<4> Rt2;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Dm{3-0};
|
|
|
|
let Inst{5} = Dm{4};
|
|
|
|
let Inst{15-12} = Rt;
|
|
|
|
let Inst{19-16} = Rt2;
|
|
|
|
|
|
|
|
let Inst{7-6} = 0b00;
|
2010-02-05 18:04:58 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-05-13 00:16:46 +00:00
|
|
|
let neverHasSideEffects = 1 in
|
2010-02-08 17:26:09 +00:00
|
|
|
def VMOVSRR : AVConv5I<0b11000100, 0b1010,
|
|
|
|
(outs SPR:$dst1, SPR:$dst2), (ins GPR:$src1, GPR:$src2),
|
2010-04-07 18:20:02 +00:00
|
|
|
IIC_fpMOVID, "vmov", "\t$dst1, $dst2, $src1, $src2",
|
2010-02-08 17:26:09 +00:00
|
|
|
[/* For disassembly only; pattern left blank */]> {
|
|
|
|
let Inst{7-6} = 0b00;
|
|
|
|
}
|
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
// FMRDH: SPR -> GPR
|
|
|
|
// FMRDL: SPR -> GPR
|
|
|
|
// FMRRS: SPR -> GPR
|
2010-10-13 20:58:46 +00:00
|
|
|
// FMRX: SPR system reg -> GPR
|
2007-01-19 07:51:42 +00:00
|
|
|
// FMSRR: GPR -> SPR
|
2010-10-13 20:58:46 +00:00
|
|
|
// FMXR: GPR -> VFP system reg
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// Int -> FP:
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
class AVConv1IDs_Encode<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3,
|
|
|
|
bits<4> opcod4, dag oops, dag iops,
|
|
|
|
InstrItinClass itin, string opc, string asm,
|
|
|
|
list<dag> pattern>
|
|
|
|
: AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
|
|
|
|
pattern> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Dd;
|
|
|
|
bits<5> Sm;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Sm{4-1};
|
|
|
|
let Inst{5} = Sm{0};
|
|
|
|
let Inst{15-12} = Dd{3-0};
|
|
|
|
let Inst{22} = Dd{4};
|
|
|
|
}
|
|
|
|
|
|
|
|
class AVConv1InSs_Encode<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3,
|
|
|
|
bits<4> opcod4, dag oops, dag iops,InstrItinClass itin,
|
|
|
|
string opc, string asm, list<dag> pattern>
|
|
|
|
: AVConv1In<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
|
|
|
|
pattern> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sd;
|
|
|
|
bits<5> Sm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Sm{4-1};
|
|
|
|
let Inst{5} = Sm{0};
|
|
|
|
let Inst{15-12} = Sd{4-1};
|
|
|
|
let Inst{22} = Sd{0};
|
|
|
|
}
|
|
|
|
|
|
|
|
def VSITOD : AVConv1IDs_Encode<0b11101, 0b11, 0b1000, 0b1011,
|
|
|
|
(outs DPR:$Dd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.s32\t$Dd, $Sm",
|
|
|
|
[(set DPR:$Dd, (f64 (arm_sitof SPR:$Sm)))]> {
|
2010-01-29 23:21:10 +00:00
|
|
|
let Inst{7} = 1; // s32
|
2008-11-11 19:40:26 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VSITOS : AVConv1InSs_Encode<0b11101, 0b11, 0b1000, 0b1010,
|
|
|
|
(outs SPR:$Sd),(ins SPR:$Sm),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.s32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (arm_sitof SPR:$Sm))]> {
|
2010-01-29 23:21:10 +00:00
|
|
|
let Inst{7} = 1; // s32
|
2008-11-11 19:40:26 +00:00
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VUITOD : AVConv1IDs_Encode<0b11101, 0b11, 0b1000, 0b1011,
|
|
|
|
(outs DPR:$Dd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTID, "vcvt", ".f64.u32\t$Dd, $Sm",
|
|
|
|
[(set DPR:$Dd, (f64 (arm_uitof SPR:$Sm)))]> {
|
2010-01-29 23:21:10 +00:00
|
|
|
let Inst{7} = 0; // u32
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VUITOS : AVConv1InSs_Encode<0b11101, 0b11, 0b1000, 0b1010,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTIS, "vcvt", ".f32.u32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (arm_uitof SPR:$Sm))]> {
|
2010-01-29 23:21:10 +00:00
|
|
|
let Inst{7} = 0; // u32
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
// FP -> Int:
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
class AVConv1IsD_Encode<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3,
|
|
|
|
bits<4> opcod4, dag oops, dag iops,
|
|
|
|
InstrItinClass itin, string opc, string asm,
|
|
|
|
list<dag> pattern>
|
|
|
|
: AVConv1I<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
|
|
|
|
pattern> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sd;
|
|
|
|
bits<5> Dm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Dm{3-0};
|
|
|
|
let Inst{5} = Dm{4};
|
|
|
|
let Inst{15-12} = Sd{4-1};
|
|
|
|
let Inst{22} = Sd{0};
|
|
|
|
}
|
|
|
|
|
|
|
|
class AVConv1InsS_Encode<bits<5> opcod1, bits<2> opcod2, bits<4> opcod3,
|
|
|
|
bits<4> opcod4, dag oops, dag iops,
|
|
|
|
InstrItinClass itin, string opc, string asm,
|
|
|
|
list<dag> pattern>
|
|
|
|
: AVConv1In<opcod1, opcod2, opcod3, opcod4, oops, iops, itin, opc, asm,
|
|
|
|
pattern> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sd;
|
|
|
|
bits<5> Sm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{3-0} = Sm{4-1};
|
|
|
|
let Inst{5} = Sm{0};
|
|
|
|
let Inst{15-12} = Sd{4-1};
|
|
|
|
let Inst{22} = Sd{0};
|
|
|
|
}
|
|
|
|
|
|
|
|
// Always set Z bit in the instruction, i.e. "round towards zero" variants.
|
|
|
|
def VTOSIZD : AVConv1IsD_Encode<0b11101, 0b11, 0b1101, 0b1011,
|
|
|
|
(outs SPR:$Sd), (ins DPR:$Dm),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".s32.f64\t$Sd, $Dm",
|
|
|
|
[(set SPR:$Sd, (arm_ftosi (f64 DPR:$Dm)))]> {
|
2008-11-11 19:40:26 +00:00
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOSIZS : AVConv1InsS_Encode<0b11101, 0b11, 0b1101, 0b1010,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".s32.f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (arm_ftosi SPR:$Sm))]> {
|
2008-11-11 19:40:26 +00:00
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOUIZD : AVConv1IsD_Encode<0b11101, 0b11, 0b1100, 0b1011,
|
|
|
|
(outs SPR:$Sd), (ins DPR:$Dm),
|
|
|
|
IIC_fpCVTDI, "vcvt", ".u32.f64\t$Sd, $Dm",
|
|
|
|
[(set SPR:$Sd, (arm_ftoui (f64 DPR:$Dm)))]> {
|
2008-11-11 19:40:26 +00:00
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOUIZS : AVConv1InsS_Encode<0b11101, 0b11, 0b1100, 0b1010,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTSI, "vcvt", ".u32.f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (arm_ftoui SPR:$Sm))]> {
|
2008-11-11 19:40:26 +00:00
|
|
|
let Inst{7} = 1; // Z bit
|
|
|
|
}
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-02-08 22:02:41 +00:00
|
|
|
// And the Z bit '0' variants, i.e. use the rounding mode specified by FPSCR.
|
|
|
|
// For disassembly only.
|
2010-08-03 21:31:55 +00:00
|
|
|
let Uses = [FPSCR] in {
|
2010-10-13 20:58:46 +00:00
|
|
|
// FIXME: Verify encoding after integrated assembler is working.
|
|
|
|
def VTOSIRD : AVConv1IsD_Encode<0b11101, 0b11, 0b1101, 0b1011,
|
|
|
|
(outs SPR:$Sd), (ins DPR:$Dm),
|
|
|
|
IIC_fpCVTDI, "vcvtr", ".s32.f64\t$Sd, $Dm",
|
|
|
|
[(set SPR:$Sd, (int_arm_vcvtr (f64 DPR:$Dm)))]>{
|
2010-02-08 22:02:41 +00:00
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOSIRS : AVConv1InsS_Encode<0b11101, 0b11, 0b1101, 0b1010,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTSI, "vcvtr", ".s32.f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (int_arm_vcvtr SPR:$Sm))]> {
|
2010-02-08 22:02:41 +00:00
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOUIRD : AVConv1IsD_Encode<0b11101, 0b11, 0b1100, 0b1011,
|
|
|
|
(outs SPR:$Sd), (ins DPR:$Dm),
|
|
|
|
IIC_fpCVTDI, "vcvtr", ".u32.f64\t$Sd, $Dm",
|
2010-10-14 01:02:08 +00:00
|
|
|
[(set SPR:$Sd, (int_arm_vcvtru(f64 DPR:$Dm)))]>{
|
2010-02-08 22:02:41 +00:00
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
|
|
|
|
2010-10-13 20:58:46 +00:00
|
|
|
def VTOUIRS : AVConv1InsS_Encode<0b11101, 0b11, 0b1100, 0b1010,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sm),
|
|
|
|
IIC_fpCVTSI, "vcvtr", ".u32.f32\t$Sd, $Sm",
|
|
|
|
[(set SPR:$Sd, (int_arm_vcvtru SPR:$Sm))]> {
|
2010-02-08 22:02:41 +00:00
|
|
|
let Inst{7} = 0; // Z bit
|
|
|
|
}
|
2010-08-03 21:31:55 +00:00
|
|
|
}
|
2010-02-08 22:02:41 +00:00
|
|
|
|
2010-02-11 18:17:16 +00: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
|
|
|
|
|
2010-11-01 23:11:22 +00:00
|
|
|
// FIXME: Marking these as codegen only seems wrong. They are real
|
|
|
|
// instructions(?)
|
|
|
|
let Constraints = "$a = $dst", isCodeGenOnly = 1 in {
|
2010-02-11 18:17:16 +00:00
|
|
|
|
|
|
|
// FP to Fixed-Point:
|
|
|
|
|
|
|
|
def VTOSHS : AVConv1XI<0b11101, 0b11, 0b1110, 0b1010, 0,
|
2010-11-01 23:17:54 +00:00
|
|
|
(outs SPR:$dst), (ins SPR:$a, i32imm:$fbits),
|
2010-02-11 18:17:16 +00:00
|
|
|
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 */]>;
|
|
|
|
|
2010-11-01 23:11:22 +00:00
|
|
|
} // End of 'let Constraints = "$a = $dst", isCodeGenOnly = 1 in'
|
2010-02-11 18:17:16 +00:00
|
|
|
|
2007-01-19 07:51:42 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP FMA Operations.
|
|
|
|
//
|
|
|
|
|
2010-11-12 20:32:20 +00:00
|
|
|
def VMLAD : ADbI<0b11100, 0b00, 0, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Ddin, DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMAC64, "vmla", ".f64\t$Dd, $Dn, $Dm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set DPR:$Dd, (fadd_mlx (fmul_su DPR:$Dn, DPR:$Dm),
|
|
|
|
(f64 DPR:$Ddin)))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Ddin = $Dd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VMLAS : ASbIn<0b11100, 0b00, 0, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sdin, SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMAC32, "vmla", ".f32\t$Sd, $Sn, $Sm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set SPR:$Sd, (fadd_mlx (fmul_su SPR:$Sn, SPR:$Sm),
|
|
|
|
SPR:$Sdin))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Sdin = $Sd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-12-05 22:04:16 +00:00
|
|
|
def : Pat<(fadd_mlx DPR:$dstin, (fmul_su DPR:$a, (f64 DPR:$b))),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VMLAD DPR:$dstin, DPR:$a, DPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
|
|
|
def : Pat<(fadd_mlx SPR:$dstin, (fmul_su SPR:$a, SPR:$b)),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VMLAS SPR:$dstin, SPR:$a, SPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP, UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-12 20:32:20 +00:00
|
|
|
def VMLSD : ADbI<0b11100, 0b00, 1, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Ddin, DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMAC64, "vmls", ".f64\t$Dd, $Dn, $Dm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set DPR:$Dd, (fadd_mlx (fneg (fmul_su DPR:$Dn,DPR:$Dm)),
|
|
|
|
(f64 DPR:$Ddin)))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Ddin = $Dd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VMLSS : ASbIn<0b11100, 0b00, 1, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sdin, SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMAC32, "vmls", ".f32\t$Sd, $Sn, $Sm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set SPR:$Sd, (fadd_mlx (fneg (fmul_su SPR:$Sn, SPR:$Sm)),
|
|
|
|
SPR:$Sdin))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Sdin = $Sd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
2010-12-05 22:04:16 +00:00
|
|
|
def : Pat<(fsub_mlx DPR:$dstin, (fmul_su DPR:$a, (f64 DPR:$b))),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VMLSD DPR:$dstin, DPR:$a, DPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
|
|
|
def : Pat<(fsub_mlx SPR:$dstin, (fmul_su SPR:$a, SPR:$b)),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VMLSS SPR:$dstin, SPR:$a, SPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2009-08-04 18:44:29 +00:00
|
|
|
|
2010-11-12 20:32:20 +00:00
|
|
|
def VNMLAD : ADbI<0b11100, 0b01, 1, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Ddin, DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMAC64, "vnmla", ".f64\t$Dd, $Dn, $Dm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set DPR:$Dd,(fsub_mlx (fneg (fmul_su DPR:$Dn,DPR:$Dm)),
|
|
|
|
(f64 DPR:$Ddin)))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Ddin = $Dd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VNMLAS : ASbI<0b11100, 0b01, 1, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sdin, SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMAC32, "vnmla", ".f32\t$Sd, $Sn, $Sm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set SPR:$Sd, (fsub_mlx (fneg (fmul_su SPR:$Sn, SPR:$Sm)),
|
|
|
|
SPR:$Sdin))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Sdin = $Sd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-12-05 22:04:16 +00:00
|
|
|
def : Pat<(fsub_mlx (fneg (fmul_su DPR:$a, (f64 DPR:$b))), DPR:$dstin),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VNMLAD DPR:$dstin, DPR:$a, DPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
|
|
|
def : Pat<(fsub_mlx (fneg (fmul_su SPR:$a, SPR:$b)), SPR:$dstin),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VNMLAS SPR:$dstin, SPR:$a, SPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-12 20:32:20 +00:00
|
|
|
def VNMLSD : ADbI<0b11100, 0b01, 0, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Ddin, DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpMAC64, "vnmls", ".f64\t$Dd, $Dn, $Dm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set DPR:$Dd, (fsub_mlx (fmul_su DPR:$Dn, DPR:$Dm),
|
|
|
|
(f64 DPR:$Ddin)))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Ddin = $Dd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-11-01 06:00:39 +00:00
|
|
|
def VNMLSS : ASbI<0b11100, 0b01, 0, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sdin, SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpMAC32, "vnmls", ".f32\t$Sd, $Sn, $Sm",
|
2010-12-05 22:04:16 +00:00
|
|
|
[(set SPR:$Sd, (fsub_mlx (fmul_su SPR:$Sn, SPR:$Sm), SPR:$Sdin))]>,
|
2010-11-12 20:32:20 +00:00
|
|
|
RegConstraint<"$Sdin = $Sd">,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2010-10-14 01:02:08 +00:00
|
|
|
|
2010-12-05 22:04:16 +00:00
|
|
|
def : Pat<(fsub_mlx (fmul_su DPR:$a, (f64 DPR:$b)), DPR:$dstin),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VNMLSD DPR:$dstin, DPR:$a, DPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,UseFPVMLx]>;
|
|
|
|
def : Pat<(fsub_mlx (fmul_su SPR:$a, SPR:$b), SPR:$dstin),
|
2010-11-12 20:32:20 +00:00
|
|
|
(VNMLSS SPR:$dstin, SPR:$a, SPR:$b)>,
|
2010-12-05 22:04:16 +00:00
|
|
|
Requires<[HasVFP2,DontUseNEONForFP,UseFPVMLx]>;
|
2007-01-19 07:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// FP Conditional moves.
|
|
|
|
//
|
|
|
|
|
2010-05-13 00:16:46 +00:00
|
|
|
let neverHasSideEffects = 1 in {
|
2010-11-01 06:00:39 +00:00
|
|
|
def VMOVDcc : ADuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpUNA64, "vmov", ".f64\t$Dd, $Dm",
|
|
|
|
[/*(set DPR:$Dd, (ARMcmov DPR:$Dn, DPR:$Dm, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$Dn = $Dd">;
|
|
|
|
|
|
|
|
def VMOVScc : ASuI<0b11101, 0b11, 0b0000, 0b01, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpUNA32, "vmov", ".f32\t$Sd, $Sm",
|
|
|
|
[/*(set SPR:$Sd, (ARMcmov SPR:$Sn, SPR:$Sm, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$Sn = $Sd">;
|
|
|
|
|
|
|
|
def VNEGDcc : ADuI<0b11101, 0b11, 0b0001, 0b01, 0,
|
|
|
|
(outs DPR:$Dd), (ins DPR:$Dn, DPR:$Dm),
|
|
|
|
IIC_fpUNA64, "vneg", ".f64\t$Dd, $Dm",
|
|
|
|
[/*(set DPR:$Dd, (ARMcneg DPR:$Dn, DPR:$Dm, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$Dn = $Dd">;
|
|
|
|
|
|
|
|
def VNEGScc : ASuI<0b11101, 0b11, 0b0001, 0b01, 0,
|
|
|
|
(outs SPR:$Sd), (ins SPR:$Sn, SPR:$Sm),
|
|
|
|
IIC_fpUNA32, "vneg", ".f32\t$Sd, $Sm",
|
|
|
|
[/*(set SPR:$Sd, (ARMcneg SPR:$Sn, SPR:$Sm, imm:$cc))*/]>,
|
|
|
|
RegConstraint<"$Sn = $Sd">;
|
2010-05-13 00:16:46 +00:00
|
|
|
} // neverHasSideEffects
|
2008-11-11 19:40:26 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Misc.
|
|
|
|
//
|
|
|
|
|
2009-11-10 19:44:56 +00:00
|
|
|
// APSR is the application level alias of CPSR. This FPSCR N, Z, C, V flags
|
|
|
|
// to APSR.
|
2009-07-20 02:12:31 +00:00
|
|
|
let Defs = [CPSR], Uses = [FPSCR] in
|
2010-11-01 23:11:22 +00:00
|
|
|
def FMSTAT : VFPAI<(outs), (ins), VFPMiscFrm, IIC_fpSTAT,
|
|
|
|
"vmrs", "\tapsr_nzcv, fpscr",
|
2010-10-14 02:33:26 +00:00
|
|
|
[(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;
|
2010-10-14 01:19:34 +00:00
|
|
|
let Inst{6-5} = 0b00;
|
2008-11-11 21:48:44 +00:00
|
|
|
let Inst{4} = 1;
|
2010-10-14 01:19:34 +00:00
|
|
|
let Inst{3-0} = 0b0000;
|
2008-11-11 21:48:44 +00:00
|
|
|
}
|
2009-10-28 01:44:26 +00:00
|
|
|
|
2010-10-14 02:33:26 +00:00
|
|
|
// FPSCR <-> GPR
|
2010-08-03 21:31:55 +00:00
|
|
|
let hasSideEffects = 1, Uses = [FPSCR] in
|
2010-10-14 01:02:08 +00:00
|
|
|
def VMRS : VFPAI<(outs GPR:$Rt), (ins), VFPMiscFrm, IIC_fpSTAT,
|
|
|
|
"vmrs", "\t$Rt, fpscr",
|
|
|
|
[(set GPR:$Rt, (int_arm_get_fpscr))]> {
|
|
|
|
// Instruction operand.
|
|
|
|
bits<4> Rt;
|
|
|
|
|
|
|
|
// Encode instruction operand.
|
|
|
|
let Inst{15-12} = Rt;
|
|
|
|
|
2010-02-09 22:35:38 +00:00
|
|
|
let Inst{27-20} = 0b11101111;
|
|
|
|
let Inst{19-16} = 0b0001;
|
|
|
|
let Inst{11-8} = 0b1010;
|
|
|
|
let Inst{7} = 0;
|
2010-10-14 01:02:08 +00:00
|
|
|
let Inst{6-5} = 0b00;
|
2010-02-09 22:35:38 +00:00
|
|
|
let Inst{4} = 1;
|
2010-10-14 01:02:08 +00:00
|
|
|
let Inst{3-0} = 0b0000;
|
2010-02-09 22:35:38 +00:00
|
|
|
}
|
|
|
|
|
2010-08-03 21:31:55 +00:00
|
|
|
let Defs = [FPSCR] in
|
|
|
|
def VMSR : VFPAI<(outs), (ins GPR:$src), VFPMiscFrm, IIC_fpSTAT,
|
|
|
|
"vmsr", "\tfpscr, $src",
|
2010-10-14 01:02:08 +00:00
|
|
|
[(int_arm_set_fpscr GPR:$src)]> {
|
|
|
|
// Instruction operand.
|
|
|
|
bits<4> src;
|
|
|
|
|
|
|
|
// Encode instruction operand.
|
|
|
|
let Inst{15-12} = src;
|
|
|
|
|
2010-02-09 22:35:38 +00:00
|
|
|
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 01:44:26 +00:00
|
|
|
|
|
|
|
// Materialize FP immediates. VFP3 only.
|
2009-11-09 00:11:35 +00:00
|
|
|
let isReMaterializable = 1 in {
|
2010-10-14 02:33:26 +00:00
|
|
|
def FCONSTD : VFPAI<(outs DPR:$Dd), (ins vfp_f64imm:$imm),
|
2010-04-07 18:19:56 +00:00
|
|
|
VFPMiscFrm, IIC_fpUNA64,
|
2010-10-14 02:33:26 +00:00
|
|
|
"vmov", ".f64\t$Dd, $imm",
|
|
|
|
[(set DPR:$Dd, vfp_f64imm:$imm)]>, Requires<[HasVFP3]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Dd;
|
|
|
|
bits<32> imm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{15-12} = Dd{3-0};
|
|
|
|
let Inst{22} = Dd{4};
|
|
|
|
let Inst{19} = imm{31};
|
|
|
|
let Inst{18-16} = imm{22-20};
|
|
|
|
let Inst{3-0} = imm{19-16};
|
|
|
|
|
|
|
|
// Encode remaining instruction bits.
|
2009-10-28 01:44:26 +00:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-20} = 0b11;
|
|
|
|
let Inst{11-9} = 0b101;
|
2010-10-14 02:33:26 +00:00
|
|
|
let Inst{8} = 1; // Double precision.
|
2009-10-28 01:44:26 +00:00
|
|
|
let Inst{7-4} = 0b0000;
|
|
|
|
}
|
|
|
|
|
2010-10-14 02:33:26 +00:00
|
|
|
def FCONSTS : VFPAI<(outs SPR:$Sd), (ins vfp_f32imm:$imm),
|
|
|
|
VFPMiscFrm, IIC_fpUNA32,
|
|
|
|
"vmov", ".f32\t$Sd, $imm",
|
|
|
|
[(set SPR:$Sd, vfp_f32imm:$imm)]>, Requires<[HasVFP3]> {
|
|
|
|
// Instruction operands.
|
|
|
|
bits<5> Sd;
|
|
|
|
bits<32> imm;
|
|
|
|
|
|
|
|
// Encode instruction operands.
|
|
|
|
let Inst{15-12} = Sd{4-1};
|
|
|
|
let Inst{22} = Sd{0};
|
|
|
|
let Inst{19} = imm{31}; // The immediate is handled as a double.
|
|
|
|
let Inst{18-16} = imm{22-20};
|
|
|
|
let Inst{3-0} = imm{19-16};
|
|
|
|
|
|
|
|
// Encode remaining instruction bits.
|
2009-10-28 01:44:26 +00:00
|
|
|
let Inst{27-23} = 0b11101;
|
|
|
|
let Inst{21-20} = 0b11;
|
|
|
|
let Inst{11-9} = 0b101;
|
2010-10-14 02:33:26 +00:00
|
|
|
let Inst{8} = 0; // Single precision.
|
2009-10-28 01:44:26 +00:00
|
|
|
let Inst{7-4} = 0b0000;
|
|
|
|
}
|
2009-11-09 00:11:35 +00:00
|
|
|
}
|