From: Akira Hatanaka Date: Sat, 8 Oct 2011 03:29:22 +0000 (+0000) Subject: Define multiclasses for FP-to-FP instructions. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bfca0798cf7ab8a9015810ce1fe6ebe804dcf38d;p=oota-llvm.git Define multiclasses for FP-to-FP instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141474 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Mips/MipsInstrFPU.td b/lib/Target/Mips/MipsInstrFPU.td index 5d2fd4ef0ee..f1e4de9077b 100644 --- a/lib/Target/Mips/MipsInstrFPU.td +++ b/lib/Target/Mips/MipsInstrFPU.td @@ -89,11 +89,13 @@ multiclass FFR1_L_M funct, string opstr> { def _D64 : FFR1; } -multiclass FFR1_2 funct, string asmstr, SDNode FOp> -{ - def _S32 : FFR1P; - def _D32 : FFR1P, - Requires<[NotFP64bit]>; +// FP-to-FP conversion instructions. +multiclass FFR1P_M funct, string opstr, SDNode OpNode> { + def _S : FFR1P; + def _D32 : FFR1P, + Requires<[NotFP64bit]>; + def _D64 : FFR1P, + Requires<[IsFP64bit]>; } multiclass FFR1_4 funct, string asmstr, SDNode FOp, bit isComm = 0> { @@ -141,11 +143,9 @@ let Predicates = [IsFP64bit] in { def CVT_D64_L : FFR1<0x21, 21, "cvt", "d.l", FGR64, FGR64>; } -let ft = 0 in { - defm FABS : FFR1_2<0b000101, "abs", fabs>; - defm FNEG : FFR1_2<0b000111, "neg", fneg>; - defm FSQRT : FFR1_2<0b000100, "sqrt", fsqrt>; -} +defm FABS : FFR1P_M<0x5, "abs", fabs>; +defm FNEG : FFR1P_M<0x7, "neg", fneg>; +defm FSQRT : FFR1P_M<0x4, "sqrt", fsqrt>; // The odd-numbered registers are only referenced when doing loads, // stores, and moves between floating-point and integer registers. @@ -333,7 +333,7 @@ def fpimm0neg : PatLeaf<(fpimm), [{ }]>; def : Pat<(f32 fpimm0), (MTC1 ZERO)>; -def : Pat<(f32 fpimm0neg), (FNEG_S32 (MTC1 ZERO))>; +def : Pat<(f32 fpimm0neg), (FNEG_S (MTC1 ZERO))>; def : Pat<(f32 (sint_to_fp CPURegs:$src)), (CVT_S_W (MTC1 CPURegs:$src))>; def : Pat<(f64 (sint_to_fp CPURegs:$src)), (CVT_D32_W (MTC1 CPURegs:$src))>;