[PATCH] D45311: [X86] Introduce wbinvd intrinsic
Gabor Buella via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 12 03:39:34 PDT 2018
GBuella updated this revision to Diff 142142.
GBuella retitled this revision from "Introduce wbinvd intrinsic" to "[X86] Introduce wbinvd intrinsic".
https://reviews.llvm.org/D45311
Files:
include/clang/Basic/BuiltinsX86.def
lib/Headers/ia32intrin.h
test/CodeGen/builtin-wbinvd.c
Index: test/CodeGen/builtin-wbinvd.c
===================================================================
--- /dev/null
+++ 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();
+}
Index: lib/Headers/ia32intrin.h
===================================================================
--- lib/Headers/ia32intrin.h
+++ 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: include/clang/Basic/BuiltinsX86.def
===================================================================
--- include/clang/Basic/BuiltinsX86.def
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45311.142142.patch
Type: text/x-patch
Size: 1335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180412/bcf94bf0/attachment.bin>
More information about the cfe-commits
mailing list