diff options
| author | Dale Johannesen <dalej@apple.com> | 2010-10-29 23:12:32 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2010-10-29 23:12:32 +0000 |
| commit | 7d3dfc0622341be00cf9b0c2ad79db93fa533068 (patch) | |
| tree | 8d98094955548454fed4641d8c5c34770f4ebe5a /clang/lib/CodeGen | |
| parent | 45834a0065374a5ed6deed5353b3ab432dafeaa4 (diff) | |
| download | bcm5719-llvm-7d3dfc0622341be00cf9b0c2ad79db93fa533068.tar.gz bcm5719-llvm-7d3dfc0622341be00cf9b0c2ad79db93fa533068.zip | |
Generate bitcasts going in and out of MMX parameters
in asm's. PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?
llvm-svn: 117736
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 4de505abdf6..282541bd02c 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -1046,6 +1046,10 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { ResultRegTypes.back() = ConvertType(InputTy); } } + if (const llvm::Type* AdjTy = + Target.adjustInlineAsmType(OutputConstraint, ResultRegTypes.back(), + VMContext)) + ResultRegTypes.back() = AdjTy; } else { ArgTypes.push_back(Dest.getAddress()->getType()); Args.push_back(Dest.getAddress()); @@ -1109,7 +1113,10 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { Arg = Builder.CreateFPExt(Arg, OutputTy); } } - + if (const llvm::Type* AdjTy = + Target.adjustInlineAsmType(InputConstraint, Arg->getType(), + VMContext)) + Arg = Builder.CreateBitCast(Arg, AdjTy); ArgTypes.push_back(Arg->getType()); Args.push_back(Arg); @@ -1204,6 +1211,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { Tmp = Builder.CreateTrunc(Tmp, TruncTy); } else if (TruncTy->isIntegerTy()) { Tmp = Builder.CreateTrunc(Tmp, TruncTy); + } else if (TruncTy->isVectorTy()) { + Tmp = Builder.CreateBitCast(Tmp, TruncTy); } } |

