Index: cfe/trunk/lib/Basic/Targets.cpp =================================================================== --- cfe/trunk/lib/Basic/Targets.cpp +++ cfe/trunk/lib/Basic/Targets.cpp @@ -2047,6 +2047,14 @@ "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", "ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15", + "xmm16", "xmm17", "xmm18", "xmm19", "xmm20", "xmm21", "xmm22", "xmm23", + "xmm24", "xmm25", "xmm26", "xmm27", "xmm28", "xmm29", "xmm30", "xmm31", + "ymm16", "ymm17", "ymm18", "ymm19", "ymm20", "ymm21", "ymm22", "ymm23", + "ymm24", "ymm25", "ymm26", "ymm27", "ymm28", "ymm29", "ymm30", "ymm31", + "zmm0", "zmm1", "zmm2", "zmm3", "zmm4", "zmm5", "zmm6", "zmm7", + "zmm8", "zmm9", "zmm10", "zmm11", "zmm12", "zmm13", "zmm14", "zmm15", + "zmm16", "zmm17", "zmm18", "zmm19", "zmm20", "zmm21", "zmm22", "zmm23", + "zmm24", "zmm25", "zmm26", "zmm27", "zmm28", "zmm29", "zmm30", "zmm31", }; const TargetInfo::AddlRegName AddlRegNames[] = { Index: cfe/trunk/lib/Parse/ParseStmtAsm.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseStmtAsm.cpp +++ cfe/trunk/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 @@ 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 MRI(TheTarget->createMCRegInfo(TT)); std::unique_ptr MAI(TheTarget->createMCAsmInfo(*MRI, TT)); // Get the instruction descriptor. std::unique_ptr MII(TheTarget->createMCInstrInfo()); std::unique_ptr MOFI(new llvm::MCObjectFileInfo()); std::unique_ptr STI( - TheTarget->createMCSubtargetInfo(TT, "", "")); + TheTarget->createMCSubtargetInfo(TT, TO.CPU, FeaturesStr)); llvm::SourceMgr TempSrcMgr; llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr); Index: cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c =================================================================== --- cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c +++ cfe/trunk/test/CodeGen/ms-inline-asm-avx512.c @@ -0,0 +1,11 @@ +// REQUIRES: x86-registered-target +// RUN: %clang_cc1 %s -triple x86_64-pc-windows-msvc -target-cpu knl -fasm-blocks -emit-llvm -o - | FileCheck %s + +void t1() { +// CHECK: @t1 +// CHECK: call void asm sideeffect inteldialect "vaddpd zmm8, zmm27, zmm6", "~{zmm8},~{dirflag},~{fpsr},~{flags}"() +// CHECK: ret void + __asm { + vaddpd zmm8, zmm27, zmm6 + } +} Index: cfe/trunk/test/Sema/asm.c =================================================================== --- cfe/trunk/test/Sema/asm.c +++ cfe/trunk/test/Sema/asm.c @@ -25,7 +25,7 @@ asm ("nop" : : : "0", "%0", "#0"); asm ("nop" : : : "foo"); // expected-error {{unknown register name 'foo' in asm}} asm ("nop" : : : "52"); - asm ("nop" : : : "104"); // expected-error {{unknown register name '104' in asm}} + asm ("nop" : : : "204"); // expected-error {{unknown register name '204' in asm}} asm ("nop" : : : "-1"); // expected-error {{unknown register name '-1' in asm}} asm ("nop" : : : "+1"); // expected-error {{unknown register name '+1' in asm}} }