diff options
author | Marina Yatsina <marina.yatsina@intel.com> | 2016-02-03 11:32:08 +0000 |
---|---|---|
committer | Marina Yatsina <marina.yatsina@intel.com> | 2016-02-03 11:32:08 +0000 |
commit | 41c45fa42d206fb3dbc3b1c540f67c57e7939b9d (patch) | |
tree | dffffd08a37a5c6316869e629e419017a6f4872c /clang/lib/Parse/ParseStmtAsm.cpp | |
parent | 1b58f5cbbb757bea043b863e52fc10e6e7dd7f90 (diff) | |
download | bcm5719-llvm-41c45fa42d206fb3dbc3b1c540f67c57e7939b9d.tar.gz bcm5719-llvm-41c45fa42d206fb3dbc3b1c540f67c57e7939b9d.zip |
-inline-asm][X86] Add ability to use AVX512 in MS inline asm
Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.
Differential Revision: http://reviews.llvm.org/D16757
llvm-svn: 259639
Diffstat (limited to 'clang/lib/Parse/ParseStmtAsm.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmtAsm.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index 11b0c0a86c9..d3a86362c88 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -17,6 +17,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstPrinter.h" @@ -522,13 +523,17 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { if (buildMSAsmString(PP, AsmLoc, AsmToks, TokOffsets, AsmString)) return StmtError(); + TargetOptions TO = Actions.Context.getTargetInfo().getTargetOpts(); + std::string FeaturesStr = + llvm::join(TO.Features.begin(), TO.Features.end(), ","); + std::unique_ptr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT)); std::unique_ptr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TT)); // Get the instruction descriptor. std::unique_ptr<llvm::MCInstrInfo> MII(TheTarget->createMCInstrInfo()); std::unique_ptr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo()); std::unique_ptr<llvm::MCSubtargetInfo> STI( - TheTarget->createMCSubtargetInfo(TT, "", "")); + TheTarget->createMCSubtargetInfo(TT, TO.CPU, FeaturesStr)); llvm::SourceMgr TempSrcMgr; llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr); |