<div dir="ltr">On Thu, Jul 17, 2014 at 5:45 AM, Yi Kong <span dir="ltr"><<a href="mailto:Yi.Kong@arm.com" target="_blank">Yi.Kong@arm.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: kongyi<br>
Date: Thu Jul 17 07:45:17 2014<br>
New Revision: 213261<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=213261&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=213261&view=rev</a><br>
Log:<br>
ARM: Add ACLE memory barrier intrinsic mapping<br>
<br>
Modified:<br>
    cfe/trunk/lib/Headers/arm_acle.h<br>
    cfe/trunk/test/CodeGen/arm_acle.c<br>
<br>
Modified: cfe/trunk/lib/Headers/arm_acle.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/arm_acle.h?rev=213261&r1=213260&r2=213261&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/arm_acle.h?rev=213261&r1=213260&r2=213261&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Headers/arm_acle.h (original)<br>
+++ cfe/trunk/lib/Headers/arm_acle.h Thu Jul 17 07:45:17 2014<br>
@@ -33,8 +33,15 @@<br>
 #if defined(__cplusplus)<br>
 extern "C" {<br>
 #endif<br>
-<br>
+<br>
 /* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */<br>
+/* 8.3 Memory barriers */<br>
+#if !defined(_MSC_VER)<br>
+#define __dmb(i) __builtin_arm_dmb(i)<br>
+#define __dsb(i) __builtin_arm_dsb(i)<br>
+#define __isb(i) __builtin_arm_isb(i)<br>
+#endif<br>
+<br>
 /* 8.4 Hints */<br>
<br>
 #if !defined(_MSC_VER)<br>
<br>
Modified: cfe/trunk/test/CodeGen/arm_acle.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm_acle.c?rev=213261&r1=213260&r2=213261&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm_acle.c?rev=213261&r1=213260&r2=213261&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/CodeGen/arm_acle.c (original)<br>
+++ cfe/trunk/test/CodeGen/arm_acle.c Thu Jul 17 07:45:17 2014<br>
@@ -3,8 +3,30 @@<br>
<br>
 #include <arm_acle.h><br>
<br>
-/* Hints */<br>
+/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */<br>
+/* 8.3 Memory Barriers */<br>
+// ARM-LABEL: test_dmb<br>
+// AArch32: call void @llvm.arm.dmb(i32 1)<br>
+// AArch64: call void @llvm.aarch64.dmb(i32 1)<br>
+void test_dmb(void) {<br>
+  __dmb(1);<br>
+}<br>
<br>
+// ARM-LABEL: test_dsb<br>
+// AArch32: call void @llvm.arm.dsb(i32 2)<br>
+// AArch64: call void @llvm.aarch64.dsb(i32 2)<br>
+void test_dsb(void) {<br>
+  __dsb(2);<br>
+}<br>
+<br>
+// ARM-LABEL: test_isb<br>
+// AArch32: call void @llvm.arm.isb(i32 3)<br>
+// AArch64: call void @llvm.aarch64.isb(i32 3)<br>
+void test_isb(void) {<br>
+  __isb(3);<br>
+}<br>
+<br>
+/* 8.4 Hints */<br>
 // ARM-LABEL: test_yield<br>
 // AArch32: call void @llvm.arm.hint(i32 1)<br>
 // AArch64: call void @llvm.aarch64.hint(i32 1)<br><br></blockquote><div><br></div><div>Might be nice to have an additional test to ensure that someone doesn't accidentally change the definitions such that they can take a non-constant value.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>