diff options
Diffstat (limited to 'test/monniaux')
-rw-r--r-- | test/monniaux/madd/madd.c | 25 | ||||
-rw-r--r-- | test/monniaux/madd/madd_run.c | 11 |
2 files changed, 36 insertions, 0 deletions
diff --git a/test/monniaux/madd/madd.c b/test/monniaux/madd/madd.c new file mode 100644 index 00000000..68f348ad --- /dev/null +++ b/test/monniaux/madd/madd.c @@ -0,0 +1,25 @@ +#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; +} + +uint64_t maddlimm(uint64_t a, uint64_t b) { + return a + b*17113; +} + +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 new file mode 100644 index 00000000..28cdf9b3 --- /dev/null +++ b/test/monniaux/madd/madd_run.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include <stdint.h> + +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 %lu\n", madd(a, b, c), maddl(a, b, c)); + return 0; +} |