[llvm-commits] [dragonegg] r149688 - in /dragonegg/trunk/src/x86: Target.cpp x86_builtins

Duncan Sands baldrick at free.fr
Sat Feb 4 00:36:40 PST 2012


Hi Craig,

On 03/02/12 17:37, Craig Topper wrote:
> I think you only wanted the 128 and 256 versions here. The ones with no suffix
> are MMX which llvm still has intrinsics for. I don't think the icmp/sext will
> work for MMX since all llvm MMX support is through intrinsics.

thanks for pointing this out.  I've gone back to intrinsics for the b/d/w ones,
but not the q ones like pcmpeqq since they are SSE only I think.

Ciao, Duncan.

>
> On Fri, Feb 3, 2012 at 1:23 AM, Duncan Sands <baldrick at free.fr
> <mailto:baldrick at free.fr>> wrote:
>
>     Author: baldrick
>     Date: Fri Feb  3 03:23:56 2012
>     New Revision: 149688
>
>     URL: http://llvm.org/viewvc/llvm-project?rev=149688&view=rev
>     <http://llvm.org/viewvc/llvm-project?rev=149688&view=rev>
>     Log:
>     Expand the various pcmp* builtins by hand now that the LLVM intrinsics
>     have been removed.  Based on Craig Topper's auto-upgrade logic.
>
>     Modified:
>         dragonegg/trunk/src/x86/Target.cpp
>         dragonegg/trunk/src/x86/x86_builtins
>
>     Modified: dragonegg/trunk/src/x86/Target.cpp
>     URL:
>     http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/Target.cpp?rev=149688&r1=149687&r2=149688&view=diff
>     <http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/Target.cpp?rev=149688&r1=149687&r2=149688&view=diff>
>     ==============================================================================
>     --- dragonegg/trunk/src/x86/Target.cpp (original)
>     +++ dragonegg/trunk/src/x86/Target.cpp Fri Feb  3 03:23:56 2012
>     @@ -859,6 +859,36 @@
>          Result = Builder.CreateShuffleVector(Ops[0], Ops[1], Mask);
>          return true;
>        }
>     +  case pcmpeqb:
>     +  case pcmpeqb128:
>     +  case pcmpeqb256:
>     +  case pcmpeqd:
>     +  case pcmpeqd128:
>     +  case pcmpeqd256:
>     +  case pcmpeqq:
>     +  case pcmpeqq256:
>     +  case pcmpeqw:
>     +  case pcmpeqw128:
>     +  case pcmpeqw256:
>     +    Result = Builder.CreateICmpEQ(Ops[0], Ops[1]);
>     +    // Need to sign extend since icmp returns a vector of i1.
>     +    Result = Builder.CreateSExt(Result, ResultType);
>     +    return true;
>     +  case pcmpgtb:
>     +  case pcmpgtb128:
>     +  case pcmpgtb256:
>     +  case pcmpgtd:
>     +  case pcmpgtd128:
>     +  case pcmpgtd256:
>     +  case pcmpgtq:
>     +  case pcmpgtq256:
>     +  case pcmpgtw:
>     +  case pcmpgtw128:
>     +  case pcmpgtw256:
>     +    Result = Builder.CreateICmpSGT(Ops[0], Ops[1]);
>     +    // Need to sign extend since icmp returns a vector of i1.
>     +    Result = Builder.CreateSExt(Result, ResultType);
>     +    return true;
>        }
>        DieAbjectly("Builtin not implemented!", stmt);
>        return false;
>
>     Modified: dragonegg/trunk/src/x86/x86_builtins
>     URL:
>     http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/x86_builtins?rev=149688&r1=149687&r2=149688&view=diff
>     <http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/x86/x86_builtins?rev=149688&r1=149687&r2=149688&view=diff>
>     ==============================================================================
>     --- dragonegg/trunk/src/x86/x86_builtins (original)
>     +++ dragonegg/trunk/src/x86/x86_builtins Fri Feb  3 03:23:56 2012
>     @@ -375,17 +375,17 @@
>       //DEFINE_BUILTIN(pbroadcastw128),
>       //DEFINE_BUILTIN(pbroadcastw256),
>       //DEFINE_BUILTIN(pclmulqdq128),
>     -//DEFINE_BUILTIN(pcmpeqb),
>     -//DEFINE_BUILTIN(pcmpeqb128),
>     -//DEFINE_BUILTIN(pcmpeqb256),
>     -//DEFINE_BUILTIN(pcmpeqd),
>     -//DEFINE_BUILTIN(pcmpeqd128),
>     -//DEFINE_BUILTIN(pcmpeqd256),
>     -//DEFINE_BUILTIN(pcmpeqq),
>     -//DEFINE_BUILTIN(pcmpeqq256),
>     -//DEFINE_BUILTIN(pcmpeqw),
>     -//DEFINE_BUILTIN(pcmpeqw128),
>     -//DEFINE_BUILTIN(pcmpeqw256),
>     +DEFINE_BUILTIN(pcmpeqb),
>     +DEFINE_BUILTIN(pcmpeqb128),
>     +DEFINE_BUILTIN(pcmpeqb256),
>     +DEFINE_BUILTIN(pcmpeqd),
>     +DEFINE_BUILTIN(pcmpeqd128),
>     +DEFINE_BUILTIN(pcmpeqd256),
>     +DEFINE_BUILTIN(pcmpeqq),
>     +DEFINE_BUILTIN(pcmpeqq256),
>     +DEFINE_BUILTIN(pcmpeqw),
>     +DEFINE_BUILTIN(pcmpeqw128),
>     +DEFINE_BUILTIN(pcmpeqw256),
>       //DEFINE_BUILTIN(pcmpestri128),
>       //DEFINE_BUILTIN(pcmpestria128),
>       //DEFINE_BUILTIN(pcmpestric128),
>     @@ -393,17 +393,17 @@
>       //DEFINE_BUILTIN(pcmpestris128),
>       //DEFINE_BUILTIN(pcmpestriz128),
>       //DEFINE_BUILTIN(pcmpestrm128),
>     -//DEFINE_BUILTIN(pcmpgtb),
>     -//DEFINE_BUILTIN(pcmpgtb128),
>     -//DEFINE_BUILTIN(pcmpgtb256),
>     -//DEFINE_BUILTIN(pcmpgtd),
>     -//DEFINE_BUILTIN(pcmpgtd128),
>     -//DEFINE_BUILTIN(pcmpgtd256),
>     -//DEFINE_BUILTIN(pcmpgtq),
>     -//DEFINE_BUILTIN(pcmpgtq256),
>     -//DEFINE_BUILTIN(pcmpgtw),
>     -//DEFINE_BUILTIN(pcmpgtw128),
>     -//DEFINE_BUILTIN(pcmpgtw256),
>     +DEFINE_BUILTIN(pcmpgtb),
>     +DEFINE_BUILTIN(pcmpgtb128),
>     +DEFINE_BUILTIN(pcmpgtb256),
>     +DEFINE_BUILTIN(pcmpgtd),
>     +DEFINE_BUILTIN(pcmpgtd128),
>     +DEFINE_BUILTIN(pcmpgtd256),
>     +DEFINE_BUILTIN(pcmpgtq),
>     +DEFINE_BUILTIN(pcmpgtq256),
>     +DEFINE_BUILTIN(pcmpgtw),
>     +DEFINE_BUILTIN(pcmpgtw128),
>     +DEFINE_BUILTIN(pcmpgtw256),
>       //DEFINE_BUILTIN(pcmpistri128),
>       //DEFINE_BUILTIN(pcmpistria128),
>       //DEFINE_BUILTIN(pcmpistric128),
>
>
>     _______________________________________________
>     llvm-commits mailing list
>     llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
>
> --
> ~Craig




More information about the llvm-commits mailing list