aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/acswap
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-11 17:19:42 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-11 17:19:42 +0200
commitb782b7fda32a910ca0f011f99c5b2864eaeb3e55 (patch)
tree4582c36a7525629cf4a9d50b88be1436c98fdb9c /test/monniaux/acswap
parentbaeed85dd8d1c7ef54a72bf2db2381d03de05cb6 (diff)
downloadcompcert-kvx-b782b7fda32a910ca0f011f99c5b2864eaeb3e55.tar.gz
compcert-kvx-b782b7fda32a910ca0f011f99c5b2864eaeb3e55.zip
__builtin_k1_acswapw
Diffstat (limited to 'test/monniaux/acswap')
-rw-r--r--test/monniaux/acswap/test_swapd.c13
-rw-r--r--test/monniaux/acswap/test_swapw.c13
2 files changed, 26 insertions, 0 deletions
diff --git a/test/monniaux/acswap/test_swapd.c b/test/monniaux/acswap/test_swapd.c
new file mode 100644
index 00000000..4841f040
--- /dev/null
+++ b/test/monniaux/acswap/test_swapd.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main() {
+ unsigned long long loc=10, next=12, current=11;
+ union {
+ __int128 i128;
+ struct {
+ unsigned long low, high;
+ } i64_2;
+ } ret;
+ ret.i128 = __builtin_k1_acswapd(&loc, next, current);
+ printf("%lx %lx\n", ret.i64_2.low, ret.i64_2.high);
+}
diff --git a/test/monniaux/acswap/test_swapw.c b/test/monniaux/acswap/test_swapw.c
new file mode 100644
index 00000000..906938e0
--- /dev/null
+++ b/test/monniaux/acswap/test_swapw.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main() {
+ unsigned loc=11, next=12, current=11;
+ union {
+ __int128 i128;
+ struct {
+ unsigned long low, high;
+ } i64_2;
+ } ret;
+ ret.i128 = __builtin_k1_acswapw(&loc, next, current);
+ printf("%lx %lx\n", ret.i64_2.low, ret.i64_2.high);
+}