Nice! Thanks! -eric
On Mar 22, 2012, at 4:25 PM, Bill Wendling <[email protected]> wrote: > Author: void > Date: Thu Mar 22 18:25:07 2012 > New Revision: 153290 > > URL: http://llvm.org/viewvc/llvm-project?rev=153290&view=rev > Log: > When an MMX output variable is tied to the input variable, we have to > implicitly > cast the value to x86_mmx. This gives the ASM string the correct call > signature. > <rdar://problem/10919182> > > Modified: > cfe/trunk/lib/CodeGen/CGStmt.cpp > cfe/trunk/test/CodeGen/asm-inout.c > > Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=153290&r1=153289&r2=153290&view=diff > ============================================================================== > --- cfe/trunk/lib/CodeGen/CGStmt.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Mar 22 18:25:07 2012 > @@ -1507,6 +1507,11 @@ > llvm::Value *Arg = EmitAsmInputLValue(S, Info, Dest, > InputExpr->getType(), > InOutConstraints); > > + if (llvm::Type* AdjTy = > + getTargetHooks().adjustInlineAsmType(*this, OutputConstraint, > + Arg->getType())) > + Arg = Builder.CreateBitCast(Arg, AdjTy); > + > if (Info.allowsRegister()) > InOutConstraints += llvm::utostr(i); > else > @@ -1565,7 +1570,7 @@ > } > } > } > - if (llvm::Type* AdjTy = > + if (llvm::Type* AdjTy = > getTargetHooks().adjustInlineAsmType(*this, InputConstraint, > Arg->getType())) > Arg = Builder.CreateBitCast(Arg, AdjTy); > > Modified: cfe/trunk/test/CodeGen/asm-inout.c > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm-inout.c?rev=153290&r1=153289&r2=153290&view=diff > ============================================================================== > --- cfe/trunk/test/CodeGen/asm-inout.c (original) > +++ cfe/trunk/test/CodeGen/asm-inout.c Thu Mar 22 18:25:07 2012 > @@ -37,3 +37,12 @@ > return (int)oldval; > // CHECK: call i8 asm "frob $0", "=r,0{{.*}}"(i8 -1) > } > + > +// <rdar://problem/10919182> - This should have both inputs be of type > x86_mmx. > +// CHECK: @test5 > +typedef long long __m64 __attribute__((__vector_size__(8))); > +__m64 test5(__m64 __A, __m64 __B) { > + // CHECK: call x86_mmx asm "pmulhuw $1, $0\0A\09", > "=y,y,0,~{dirflag},~{fpsr},~{flags}"(x86_mmx %{{.}}, x86_mmx %{{.}}) > + asm("pmulhuw %1, %0\n\t" : "+y" (__A) : "y" (__B)); > + return __A; > +} > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
