[llvm] r242191 - [MMX] Use the appropriate instructions for GR64 <-> VR64 copies.

Alex L arphaman at gmail.com
Tue Jul 28 10:54:39 PDT 2015


Hi Bruno,

I've committed a test case for this commit in r243457.

Alex

2015-07-14 13:09 GMT-07:00 Bruno Cardoso Lopes <bruno.cardoso at gmail.com>:

> Author: bruno
> Date: Tue Jul 14 15:09:34 2015
> New Revision: 242191
>
> URL: http://llvm.org/viewvc/llvm-project?rev=242191&view=rev
> Log:
> [MMX] Use the appropriate instructions for GR64 <-> VR64 copies.
>
> MOVSDto64rr and MOV64toSDrr are defined to convert between FR64 (%xmm)
> <-> GR64 registers, not VR64 (%mm) <-> GR64. This is wrong.
>
> I found this by inspection and could not find a suitable testcase for it
> since (1) we don't handle MMX bitcasts in Peephole optimizer as to
> generate COPYs that (2) could be expanded back to the appropriate x86
> instruction in ExpandPostRA.
>
> Switch to use the appropriate instructions: MMX_MOVD64from64rr and
> MMX_MOVD64to64rr here.
>
> Modified:
>     llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=242191&r1=242190&r2=242191&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Jul 14 15:09:34 2015
> @@ -3806,7 +3806,7 @@ static unsigned CopyToFromAsymmetricReg(
>                                                 X86::MOVPQIto64rr);
>      if (X86::VR64RegClass.contains(SrcReg))
>        // Copy from a VR64 register to a GR64 register.
> -      return X86::MOVSDto64rr;
> +      return X86::MMX_MOVD64from64rr;
>    } else if (X86::GR64RegClass.contains(SrcReg)) {
>      // Copy from a GR64 register to a VR128 register.
>      if (X86::VR128XRegClass.contains(DestReg))
> @@ -3814,7 +3814,7 @@ static unsigned CopyToFromAsymmetricReg(
>                                                 X86::MOV64toPQIrr);
>      // Copy from a GR64 register to a VR64 register.
>      if (X86::VR64RegClass.contains(DestReg))
> -      return X86::MOV64toSDrr;
> +      return X86::MMX_MOVD64to64rr;
>    }
>
>    // SrcReg(FR32) -> DestReg(GR32)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150728/de384d9e/attachment.html>


More information about the llvm-commits mailing list