[PATCH] D45311: [X86] Introduce wbinvd intrinsic
Gabor Buella via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 12 11:45:12 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL329937: [X86] Introduce wbinvd intrinsic (authored by GBuella, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D45311?vs=142142&id=142228#toc
Repository:
rL LLVM
https://reviews.llvm.org/D45311
Files:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/ia32intrin.h
cfe/trunk/test/CodeGen/builtin-wbinvd.c
Index: cfe/trunk/lib/Headers/ia32intrin.h
===================================================================
--- cfe/trunk/lib/Headers/ia32intrin.h
+++ cfe/trunk/lib/Headers/ia32intrin.h
@@ -70,4 +70,9 @@
#define _rdpmc(A) __rdpmc(A)
+static __inline__ void __attribute__((__always_inline__, __nodebug__))
+_wbinvd(void) {
+ return __builtin_ia32_wbinvd();
+}
+
#endif /* __IA32INTRIN_H */
Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -679,7 +679,8 @@
//CLWB
TARGET_BUILTIN(__builtin_ia32_clwb, "vvC*", "", "clwb")
-//WBNOINVD
+//WB[NO]INVD
+TARGET_BUILTIN(__builtin_ia32_wbinvd, "v", "", "")
TARGET_BUILTIN(__builtin_ia32_wbnoinvd, "v", "", "wbnoinvd")
// ADX
Index: cfe/trunk/test/CodeGen/builtin-wbinvd.c
===================================================================
--- cfe/trunk/test/CodeGen/builtin-wbinvd.c
+++ cfe/trunk/test/CodeGen/builtin-wbinvd.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -ffreestanding -triple=i386-unknown-unknown -emit-llvm -o - -Wall -Werror | FileCheck %s
+
+#include <x86intrin.h>
+
+void test_wbinvd(void) {
+ //CHECK-LABEL: @test_wbinvd
+ //CHECK: call void @llvm.x86.wbinvd()
+ _wbinvd();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45311.142228.patch
Type: text/x-patch
Size: 1445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180412/1281201f/attachment.bin>
More information about the cfe-commits
mailing list