aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-08-01 17:23:31 +0200
committerCyril SIX <cyril.six@kalray.eu>2018-08-01 17:23:31 +0200
commit080875012a740b9fbe9ad9e1d147543ce538a955 (patch)
tree7c24e0114b744bc126ea7e021535c6d2a3aa5e35 /test/mppa
parent265fdd4f703b0310fbcf5ad448c29dc34f7ff33a (diff)
downloadcompcert-kvx-080875012a740b9fbe9ad9e1d147543ce538a955.tar.gz
compcert-kvx-080875012a740b9fbe9ad9e1d147543ce538a955.zip
Added all the working builtins for ALU. Added BCU and LSU without testing
Diffstat (limited to 'test/mppa')
-rw-r--r--test/mppa/general/clzd.c7
-rw-r--r--test/mppa/general/clzll.c7
-rw-r--r--test/mppa/general/clzw.c7
-rw-r--r--test/mppa/general/ctzd.c7
-rw-r--r--test/mppa/general/ctzw.c7
-rw-r--r--test/mppa/general/framework.h11
-rw-r--r--test/mppa/general/satd.c7
-rw-r--r--test/mppa/general/sbmm8.c7
-rw-r--r--test/mppa/general/sbmmt8.c7
-rw-r--r--test/mppa/general/stsud.c4
-rw-r--r--test/mppa/generate.sh8
11 files changed, 68 insertions, 11 deletions
diff --git a/test/mppa/general/clzd.c b/test/mppa/general/clzd.c
new file mode 100644
index 00000000..4bedab97
--- /dev/null
+++ b/test/mppa/general/clzd.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 1)
+{
+ c = __builtin_k1_clzd(t[0]);
+}
+END_TEST()
diff --git a/test/mppa/general/clzll.c b/test/mppa/general/clzll.c
deleted file mode 100644
index 13905cba..00000000
--- a/test/mppa/general/clzll.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "framework.h"
-
-BEGIN_TEST(long long)
-{
- c = __builtin_clzll(a);
-}
-END_TEST()
diff --git a/test/mppa/general/clzw.c b/test/mppa/general/clzw.c
new file mode 100644
index 00000000..361492f2
--- /dev/null
+++ b/test/mppa/general/clzw.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 1)
+{
+ c = __builtin_k1_clzw(t[0]);
+}
+END_TEST()
diff --git a/test/mppa/general/ctzd.c b/test/mppa/general/ctzd.c
new file mode 100644
index 00000000..6f6586ad
--- /dev/null
+++ b/test/mppa/general/ctzd.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 1)
+{
+ c = __builtin_k1_ctzd(t[0]);
+}
+END_TEST()
diff --git a/test/mppa/general/ctzw.c b/test/mppa/general/ctzw.c
new file mode 100644
index 00000000..b0f2c937
--- /dev/null
+++ b/test/mppa/general/ctzw.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 1)
+{
+ c = __builtin_k1_ctzw(t[0]);
+}
+END_TEST()
diff --git a/test/mppa/general/framework.h b/test/mppa/general/framework.h
index 78f2617e..b7dc4933 100644
--- a/test/mppa/general/framework.h
+++ b/test/mppa/general/framework.h
@@ -3,6 +3,17 @@
#include "../lib/prng.c"
+#define BEGIN_TEST_N(type, N)\
+ int main(void){\
+ type t[N], c, i, j, S;\
+ srand(0);\
+ S = 0;\
+ for (i = 0 ; i < 100 ; i++){\
+ c = randlong();\
+ for (j = 0 ; j < N ; j++)\
+ t[j] = randlong();\
+ /* END BEGIN_TEST_N */
+
#define BEGIN_TEST(type)\
int main(void){\
type a, b, c, i, S;\
diff --git a/test/mppa/general/satd.c b/test/mppa/general/satd.c
new file mode 100644
index 00000000..d8d0d256
--- /dev/null
+++ b/test/mppa/general/satd.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 2)
+{
+ c = __builtin_k1_satd(t[0], t[1]);
+}
+END_TEST()
diff --git a/test/mppa/general/sbmm8.c b/test/mppa/general/sbmm8.c
new file mode 100644
index 00000000..beced8fc
--- /dev/null
+++ b/test/mppa/general/sbmm8.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 2)
+{
+ c = __builtin_k1_sbmm8(t[0], t[1]);
+}
+END_TEST()
diff --git a/test/mppa/general/sbmmt8.c b/test/mppa/general/sbmmt8.c
new file mode 100644
index 00000000..8a64e7e7
--- /dev/null
+++ b/test/mppa/general/sbmmt8.c
@@ -0,0 +1,7 @@
+#include "framework.h"
+
+BEGIN_TEST_N(unsigned long long, 2)
+{
+ c = __builtin_k1_sbmmt8(t[0], t[1]);
+}
+END_TEST()
diff --git a/test/mppa/general/stsud.c b/test/mppa/general/stsud.c
index 81fb6e6d..fb07b94f 100644
--- a/test/mppa/general/stsud.c
+++ b/test/mppa/general/stsud.c
@@ -1,7 +1,7 @@
#include "framework.h"
-BEGIN_TEST(unsigned long long)
+BEGIN_TEST_N(unsigned long long, 2)
{
- c = __builtin_k1_stsud(a, b);
+ c = __builtin_k1_stsud(t[0], t[1]);
}
END_TEST()
diff --git a/test/mppa/generate.sh b/test/mppa/generate.sh
index 765128d4..ea633724 100644
--- a/test/mppa/generate.sh
+++ b/test/mppa/generate.sh
@@ -4,14 +4,18 @@
cfile="$1"
writefile="$2"
+dirwritefile=$(dirname $writefile)
+asmdir=$dirwritefile/../asm/gcc
+
if [ ! -f $cfile ]; then
>&2 echo "ERROR: $cfile not found"
shift; continue
fi
-mkdir -p $(dirname $writefile)
+mkdir -p $dirwritefile
+mkdir -p $asmdir
-#sed -n "s/^.*\/\*\s*RETURN VALUE:\s*\([0-9]*\)\s*\*\//\1/p" $1 > $2
tmpbin=/tmp/k1-$(basename $1)-bin
+k1-gcc -O0 $1 -S -o $asmdir/$(basename $1).s
k1-gcc -O0 $1 -o $tmpbin
(k1-cluster -- $tmpbin; echo $? > $2)