aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa/instr/i64.c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-05-26 22:11:32 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-05-26 22:11:32 +0200
commitbc1e43ea95b9455cdccee442db77bc5fafd3dcc6 (patch)
tree4e82b5f50870603f42ec46d57e543c3e10fb1f4f /test/mppa/instr/i64.c
parentb4a08d0815342b6238d307864f0823d0f07bb691 (diff)
downloadcompcert-kvx-bc1e43ea95b9455cdccee442db77bc5fafd3dcc6.tar.gz
compcert-kvx-bc1e43ea95b9455cdccee442db77bc5fafd3dcc6.zip
tests for kvx
Diffstat (limited to 'test/mppa/instr/i64.c')
-rw-r--r--test/mppa/instr/i64.c169
1 files changed, 0 insertions, 169 deletions
diff --git a/test/mppa/instr/i64.c b/test/mppa/instr/i64.c
deleted file mode 100644
index e869d93c..00000000
--- a/test/mppa/instr/i64.c
+++ /dev/null
@@ -1,169 +0,0 @@
-#include "framework.h"
-
-long long sum(long long a, long long b){
- return a+b;
-}
-
-long long diff(long long a, long long b){
- return a-b;
-}
-
-long long mul(long long a, long long b){
- return a*b;
-}
-
-long long make(long long a){
- return a;
-}
-
-long long random_op(long long a, long long b){
- long long d = 3;
- long long (*op)(long long, long long);
-
- if (a % d == 0)
- op = sum;
- else if (a % d == 1)
- op = diff;
- else
- op = mul;
-
- return op(a, b);
-}
-
-long fact(long a){
- long r = 1;
- long i;
- for (i = 1; i < a; i++)
- r *= i;
- return r;
-}
-
-double long2double(long v){
- return v;
-}
-
-BEGIN_TEST(long long)
- c = a&b;
- c += a*b;
- c += -a;
- c += a | b;
- c += a-b;
- c += a >> (b & 0x8LL);
- c += a >> (b & 0x8ULL);
- c += a % b;
- c += (a << 4); // addx16d
- c += (a << 3); // addx8d
- c += (a << 2); // addx4d
- c += (a << 1); // addx2d
-
- c += ~a & b; // andnd
-
- long long d = 3;
- long long (*op)(long long, long long);
-
- if (a % d == 0)
- op = sum;
- else if (a % d == 1)
- op = diff;
- else
- op = mul;
-
- c += op(make(a), make(b));
- c += random_op(a, b);
- c += a/b;
- c += a^b;
- c += (unsigned int) a;
-
- /* Testing if, cb */
- if (0 != (a & 0x1LL))
- c += fact(1);
- else
- c += fact(2);
-
- if (0 > (a & 0x1LL))
- c += fact(4);
- else
- c += fact(8);
-
- if (0 >= (a & 0x1LL) - 1)
- c += fact(16);
- else
- c += fact(32);
-
- if ((unsigned long long)(a & 0x1LL) >= 1)
- c += fact(18);
- else
- c += fact(31);
-
-
- if (a-41414141 > 0)
- c += fact(13);
- else
- c += fact(31);
-
- if (a & 0x1LL > 0)
- c += fact(64);
- else
- c += fact(128);
-
- if ((a & 0x1LL) - 1 >= 0)
- c += fact(256);
- else
- c += fact(512);
-
- if (0 == (a & 0x1LL))
- c += fact(1024);
- else
- c += fact(2048);
-
- /* Testing if, cmoved */
- if (0 != (a & 0x1LL))
- c += 1;
- else
- c += 2;
-
- if (0 > (a & 0x1LL))
- c += 4;
- else
- c += 8;
-
- if (0 >= (a & 0x1LL) - 1)
- c += 16;
- else
- c += 32;
-
- if (a-41414141 > 0)
- c += 13;
- else
- c += 31;
-
- if (a & 0x1LL > 0)
- c += 64;
- else
- c += 128;
-
- if ((a & 0x1LL) - 1 >= 0)
- c += 256;
- else
- c += 512;
-
- if (0 == (a & 0x1LL))
- c += 1024;
- else
- c += 2048;
-
- c += ((a & 0x1LL) == (b & 0x1LL));
- c += (a >= b);
- c += (a > b);
- c += (a <= b);
- c += (a < b);
- c += (long) long2double(a) + (long) long2double(b) + (long) long2double(42.3);
-
- int j;
-
- for (j = 0 ; j < (b & 0x8LL) ; j++)
- c += a;
-
- c += ((a & 0x1LL) == (b & 0x1LL));
-
-END_TEST64()