aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/madd
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 09:49:45 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 09:49:45 +0100
commita0c25ff1259a8373fb71e780f70d28916c321612 (patch)
tree043fdf2bf1c56844d37603b13f7684858edf2155 /test/monniaux/madd
parent5487cf64164eeea716e3ad140977aa73ccbe00ce (diff)
downloadcompcert-kvx-a0c25ff1259a8373fb71e780f70d28916c321612.tar.gz
compcert-kvx-a0c25ff1259a8373fb71e780f70d28916c321612.zip
maddl / maddlim are synthesized (but not for pointers it seems)
Diffstat (limited to 'test/monniaux/madd')
-rw-r--r--test/monniaux/madd/madd.c20
-rw-r--r--test/monniaux/madd/madd_run.c6
2 files changed, 21 insertions, 5 deletions
diff --git a/test/monniaux/madd/madd.c b/test/monniaux/madd/madd.c
index f847edf3..68f348ad 100644
--- a/test/monniaux/madd/madd.c
+++ b/test/monniaux/madd/madd.c
@@ -1,11 +1,25 @@
-unsigned madd(unsigned a, unsigned b, unsigned c) {
+#include <stdint.h>
+
+uint32_t madd(uint32_t a, uint32_t b, uint32_t c) {
+ return a + b*c;
+}
+
+uint32_t maddimm(uint32_t a, uint32_t b) {
+ return a + b*17113;
+}
+
+uint32_t madd2(uint32_t a, uint32_t b, uint32_t c) {
+ return c + b*a;
+}
+
+uint64_t maddl(uint64_t a, uint64_t b, uint64_t c) {
return a + b*c;
}
-unsigned maddimm(unsigned a, unsigned b) {
+uint64_t maddlimm(uint64_t a, uint64_t b) {
return a + b*17113;
}
-unsigned madd2(unsigned a, unsigned b, unsigned c) {
+uint64_t maddl2(uint64_t a, uint64_t b, uint64_t c) {
return c + b*a;
}
diff --git a/test/monniaux/madd/madd_run.c b/test/monniaux/madd/madd_run.c
index d4238c53..28cdf9b3 100644
--- a/test/monniaux/madd/madd_run.c
+++ b/test/monniaux/madd/madd_run.c
@@ -1,9 +1,11 @@
#include <stdio.h>
+#include <stdint.h>
-extern unsigned madd(unsigned a, unsigned b, unsigned c);
+extern uint32_t madd(uint32_t a, uint32_t b, uint32_t c);
+extern uint64_t maddl(uint64_t a, uint64_t b, uint64_t c);
int main() {
unsigned a = 7, b = 3, c = 4;
- printf("res = %u\n", madd(a, b, c));
+ printf("res = %u %lu\n", madd(a, b, c), maddl(a, b, c));
return 0;
}