Skip to content
ARMInstrVFP.td 39.8 KiB
Newer Older
  let Inst{11-8}  = 0b1010;
  let Inst{7}     = 0;
  let Inst{4}     = 1;
}

// Materialize FP immediates. VFP3 only.
let isReMaterializable = 1 in {
def FCONSTD : VFPAI<(outs DPR:$Dd), (ins vfp_f64imm:$imm),
                    "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.
  let Inst{27-23} = 0b11101;
  let Inst{21-20} = 0b11;
  let Inst{11-9}  = 0b101;
  let Inst{8}     = 1;          // Double precision.
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.
  let Inst{27-23} = 0b11101;
  let Inst{21-20} = 0b11;
  let Inst{11-9}  = 0b101;
  let Inst{8}     = 0;          // Single precision.