[llvm] r249123 - [mips][microMIPS] Fix an issue with selecting sqrt instruction in LLVM backend

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 08:20:31 PDT 2015


Don't forget to credit the author when committing for someone else. According to Phabricator this patch was by Zlatko Buljan. Also, only the subject line seems to be in the commit message.

I've reverted this and re-committed it as r249416 with the whole commit message and the proper attribution.

> -----Original Message-----
> From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On Behalf
> Of Zoran Jovanovic via llvm-commits
> Sent: 02 October 2015 14:06
> To: llvm-commits at lists.llvm.org
> Subject: [llvm] r249123 - [mips][microMIPS] Fix an issue with selecting sqrt
> instruction in LLVM backend
> 
> Author: zjovanovic
> Date: Fri Oct  2 08:06:02 2015
> New Revision: 249123
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=249123&view=rev
> Log:
> [mips][microMIPS] Fix an issue with selecting sqrt instruction in LLVM
> backend
> Differential Revision: http://reviews.llvm.org/D13235
> 
> Added:
>     llvm/trunk/test/CodeGen/Mips/llvm-ir/sqrt.ll
> Modified:
>     llvm/trunk/lib/Target/Mips/MipsInstrFPU.td
> 
> Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=249123&r1=249122
> &r2=249123&view=diff
> ==========================================================
> ====================
> --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original)
> +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Fri Oct  2 08:06:02 2015
> @@ -353,11 +353,8 @@ def FNEG_S : MMRel, ABSS_FT<"neg.s", FGR
>  defm FABS : ABSS_M<"abs.d", II_ABS, fabs>, ABSS_FM<0x5, 17>;
>  defm FNEG : ABSS_M<"neg.d", II_NEG, fneg>, ABSS_FM<0x7, 17>;
> 
> -let AdditionalPredicates = [NotInMicroMips] in {
> -def FSQRT_S : MMRel, ABSS_FT<"sqrt.s", FGR32Opnd, FGR32Opnd,
> II_SQRT_S, fsqrt>,
> -              ABSS_FM<0x4, 16>, ISA_MIPS2;
> -}
> -
> +def FSQRT_S : MMRel, StdMMR6Rel, ABSS_FT<"sqrt.s", FGR32Opnd,
> FGR32Opnd,
> +              II_SQRT_S, fsqrt>, ABSS_FM<0x4, 16>, ISA_MIPS2;
>  defm FSQRT : ABSS_M<"sqrt.d", II_SQRT_D, fsqrt>, ABSS_FM<0x4, 17>,
> ISA_MIPS2;
> 
>  // The odd-numbered registers are only referenced when doing loads,
> 
> Added: llvm/trunk/test/CodeGen/Mips/llvm-ir/sqrt.ll
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/test/CodeGen/Mips/llvm-
> ir/sqrt.ll?rev=249123&view=auto
> ==========================================================
> ====================
> --- llvm/trunk/test/CodeGen/Mips/llvm-ir/sqrt.ll (added)
> +++ llvm/trunk/test/CodeGen/Mips/llvm-ir/sqrt.ll Fri Oct  2 08:06:02 2015
> @@ -0,0 +1,13 @@
> +; RUN: llc < %s -march=mipsel -mcpu=mips32r2 -mattr=+micromips |
> FileCheck %s
> +; RUN: llc < %s -march=mips -mcpu=mips32r2 -mattr=+micromips |
> FileCheck %s
> +; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips |
> FileCheck %s
> +
> +define float @sqrt_fn(float %value) #0 {
> +entry:
> +  %sqrtf = tail call float @sqrtf(float %value) #0
> +  ret float %sqrtf
> +}
> +
> +declare float @sqrtf(float)
> +
> +; CHECK: sqrt.s $f0, $f12
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list