aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa/instr
diff options
context:
space:
mode:
Diffstat (limited to 'test/mppa/instr')
-rw-r--r--test/mppa/instr/i32.c48
-rw-r--r--test/mppa/instr/i64.c43
2 files changed, 91 insertions, 0 deletions
diff --git a/test/mppa/instr/i32.c b/test/mppa/instr/i32.c
index 4e389620..e350931c 100644
--- a/test/mppa/instr/i32.c
+++ b/test/mppa/instr/i32.c
@@ -28,6 +28,7 @@ BEGIN_TEST(int)
c = a+b;
c += a&b;
+ /* testing if, cb version */
if ((a & 0x1) == 1)
c += fact(1);
else
@@ -38,6 +39,11 @@ BEGIN_TEST(int)
else
c += fact(8);
+ if (a & 0x1 == 0)
+ c += fact(4);
+ else
+ c += fact(8);
+
b = !(a & 0x01);
if (!b)
c += fact(16);
@@ -67,6 +73,48 @@ BEGIN_TEST(int)
else
c += fact(8192);
+ /* cmoved version */
+ if ((a & 0x1) == 1)
+ c += 1;
+ else
+ c += 2;
+
+ if (a & 0x1 == 0)
+ c += 4;
+ else
+ c += 8;
+
+ if (a & 0x1 == 0)
+ c += 4;
+ else
+ c += 8;
+
+ b = !(a & 0x01);
+ if (!b)
+ c += 16;
+ else
+ c += 32;
+
+ if (0 > (a & 0x1) - 1)
+ c += 64;
+ else
+ c += 128;
+
+ if (0 >= (a & 0x1))
+ c += 256;
+ else
+ c += 512;
+
+ if ((a & 0x1) > 0)
+ c += 1024;
+ else
+ c += 2048;
+
+ if ((a & 0x1) - 1 >= 0)
+ c += 4096;
+ else
+ c += 8192;
+
c += ((a & 0x1) == (b & 0x1));
c += (a > b);
c += (a <= b);
diff --git a/test/mppa/instr/i64.c b/test/mppa/instr/i64.c
index dc5fa6ee..e869d93c 100644
--- a/test/mppa/instr/i64.c
+++ b/test/mppa/instr/i64.c
@@ -74,6 +74,7 @@ BEGIN_TEST(long long)
c += a^b;
c += (unsigned int) a;
+ /* Testing if, cb */
if (0 != (a & 0x1LL))
c += fact(1);
else
@@ -89,6 +90,12 @@ BEGIN_TEST(long long)
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
@@ -109,6 +116,42 @@ BEGIN_TEST(long long)
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);