[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/part_select.c part_select.reference_output

Reid Spencer reid at x10sys.com
Sat May 12 11:41:30 PDT 2007



Changes in directory llvm-test/SingleSource/UnitTests/Integer:

part_select.c updated: 1.4 -> 1.5
part_select.reference_output updated: 1.2 -> 1.3
---
Log message:

Make the output easier to validate.


---
Diffs of the changes:  (+65 -53)

 part_select.c                |   25 ++++++++---
 part_select.reference_output |   93 +++++++++++++++++++++----------------------
 2 files changed, 65 insertions(+), 53 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/part_select.c
diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.4 llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.5
--- llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.4	Tue Apr 17 19:53:49 2007
+++ llvm-test/SingleSource/UnitTests/Integer/part_select.c	Sat May 12 13:41:12 2007
@@ -17,10 +17,10 @@
 
 #ifdef ENABLE_LARGE_INTEGERS
 typedef uint256 BitType;
-const BitType X = 0xFEDCBA9876543210ULL;
+const BitType X = 0xAAAAAAAAAAAAAAAAULL;
 #else
 typedef uint47 BitType;
-const BitType X = 0xFEDCBA9876543210ULL;
+const BitType X = 0xAAAAAAAAAAAAAAAAULL;
 #endif
 
 int main(int argc, char** argv)
@@ -37,15 +37,26 @@
   unsigned i, j;
 
   for (i = 0; i < bitwidthof(BitType); ++i) {
-    BitType left = rand() % bitwidthof(BitType);
-    BitType right = i;
-    printf("part_select(Y, %3u, %3u) = ", (unsigned)left, (unsigned)right);
-    BitType Z = part_select(Y, right, left );
+    BitType high = rand() % bitwidthof(BitType);
+    BitType low = i;
+    printf("part_select(Y, %3u, %3u) = ", (unsigned)low, (unsigned)high);
+    BitType Z = part_select(Y, low, high );
     printBits(Z);
     uint64_t val = Z;
-    printf(" (%lx)", val);
+    printf(" (%llx)", val);
     printf("\n");
   }
 
+  BitType Z = part_select(Y, 0, bitwidthof(Y)-1);
+  if (Z == Y)
+    printf(" True: ");
+  else
+    printf("False: ");
+  printBits(Z);
+  printf(" == ");
+  printBits(Y);
+  printf("\n");
+
+
   return 0;
 }


Index: llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output
diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.3
--- llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.2	Mon Feb 12 17:17:34 2007
+++ llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output	Sat May 12 13:41:12 2007
@@ -1,48 +1,49 @@
-part_select(Y,  38,   0) = 00000000001100001110110010101000011001000010000 (76543210)
-part_select(Y,   4,   1) = 00000000000000000000000000000000000000000001000 (8)
-part_select(Y,  18,   2) = 00000000000000000000000000000010000110010000100 (10c84)
-part_select(Y,  23,   3) = 00000000000000000000000000010101000011001000010 (a8642)
-part_select(Y,  17,   4) = 00000000000000000000000000000000000001100100001 (321)
-part_select(Y,  26,   5) = 00000000000000000000000001100101010000110010000 (32a190)
-part_select(Y,  16,   6) = 00000000000000000000000000000000000000011001000 (c8)
-part_select(Y,   3,   7) = 00000000000000000000000000000000000000000001000 (8)
-part_select(Y,  28,   8) = 00000000000000000000000000101100101010000110010 (165432)
-part_select(Y,  28,   9) = 00000000000000000000000000010110010101000011001 (b2a19)
+part_select(Y,   0,  38) = 00000000010101010101010101010101010101010101010 (2aaaaaaaaa)
+part_select(Y,   1,   4) = 00000000000000000000000000000000000000000000101 (5)
+part_select(Y,   2,  18) = 00000000000000000000000000000001010101010101010 (aaaa)
+part_select(Y,   3,  23) = 00000000000000000000000000101010101010101010101 (155555)
+part_select(Y,   4,  17) = 00000000000000000000000000000000010101010101010 (2aaa)
+part_select(Y,   5,  26) = 00000000000000000000000000101010101010101010101 (155555)
+part_select(Y,   6,  16) = 00000000000000000000000000000000000001010101010 (2aa)
+part_select(Y,   7,   3) = 00000000000000000000000000000000000000000010101 (15)
+part_select(Y,   8,  28) = 00000000000000000000000000010101010101010101010 (aaaaa)
+part_select(Y,   9,  28) = 00000000000000000000000000001010101010101010101 (55555)
 part_select(Y,  10,  10) = 00000000000000000000000000000000000000000000000 (0)
-part_select(Y,  17,  11) = 00000000000000000000000000000000000000000000110 (6)
-part_select(Y,  44,  12) = 00000000000000110101001100001110110010101000011 (a9876543)
-part_select(Y,  28,  13) = 00000000000000000000000000000001011001010100001 (b2a1)
-part_select(Y,   2,  14) = 00000000000000000000000000000000000010000100110 (426)
-part_select(Y,  20,  15) = 00000000000000000000000000000000000000000101000 (28)
-part_select(Y,  22,  16) = 00000000000000000000000000000000000000001010100 (54)
-part_select(Y,  21,  17) = 00000000000000000000000000000000000000000001010 (a)
-part_select(Y,  18,  18) = 00000000000000000000000000000000000000000000001 (1)
-part_select(Y,  36,  19) = 00000000000000000000000000000110000111011001010 (30eca)
-part_select(Y,  34,  20) = 00000000000000000000000000000000000011101100101 (765)
-part_select(Y,  37,  21) = 00000000000000000000000000000001100001110110010 (c3b2)
-part_select(Y,  18,  22) = 00000000000000000000000000000000000000000010101 (15)
-part_select(Y,  38,  23) = 00000000000000000000000000000000011000011101100 (30ec)
-part_select(Y,  20,  24) = 00000000000000000000000000000000000000000010100 (14)
-part_select(Y,   1,  25) = 00000000000000000000000001000010011000010101001 (2130a9)
-part_select(Y,  31,  26) = 00000000000000000000000000000000000000000011101 (1d)
-part_select(Y,  17,  27) = 00000000000000000000000000000000000001010100110 (2a6)
-part_select(Y,  20,  28) = 00000000000000000000000000000000000000101001101 (14d)
-part_select(Y,   6,  29) = 00000000000000000000000000100110000101010011011 (130a9b)
-part_select(Y,  27,  30) = 00000000000000000000000000000000000000000000111 (7)
-part_select(Y,  37,  31) = 00000000000000000000000000000000000000000110000 (30)
-part_select(Y,  11,  32) = 00000000000000000000000000110000101010011011100 (1854dc)
-part_select(Y,  24,  33) = 00000000000000000000000000000000000000110111000 (1b8)
-part_select(Y,  39,  34) = 00000000000000000000000000000000000000000100110 (26)
-part_select(Y,   7,  35) = 00000000000000000000100110000101010011011100001 (4c2a6e1)
-part_select(Y,   3,  36) = 00000000000000100001001100001010100110111000011 (9854dc3)
-part_select(Y,   9,  37) = 00000000000000000010011000010101001101110000110 (130a9b86)
-part_select(Y,  36,  38) = 00000000000000000000000000000000000000000000100 (4)
-part_select(Y,  31,  39) = 00000000000000000000000000000000000000000011001 (19)
-part_select(Y,  16,  40) = 00000000000000000000000010101001101110000110010 (54dc32)
-part_select(Y,  46,  41) = 00000000000000000000000000000000000000000011101 (1d)
-part_select(Y,  27,  42) = 00000000000000000000000000000000111000011001010 (70ca)
-part_select(Y,  13,  43) = 00000000000000001000010101001101110000110010101 (42a6e195)
-part_select(Y,   6,  44) = 00000000000100110000101010011011100001100101011 (854dc32b)
-part_select(Y,   9,  45) = 00000000001001100001010100110111000011001010111 (a9b8657)
-part_select(Y,  13,  46) = 00000000000001000010101001101110000110010101110 (15370cae)
+part_select(Y,  11,  17) = 00000000000000000000000000000000000000001010101 (55)
+part_select(Y,  12,  44) = 00000000000000010101010101010101010101010101010 (aaaaaaaa)
+part_select(Y,  13,  28) = 00000000000000000000000000000000101010101010101 (5555)
+part_select(Y,  14,   2) = 00000000000000000000000000000000000101010101010 (aaa)
+part_select(Y,  15,  20) = 00000000000000000000000000000000000000000010101 (15)
+part_select(Y,  16,  22) = 00000000000000000000000000000000000000000101010 (2a)
+part_select(Y,  17,  21) = 00000000000000000000000000000000000000000010101 (15)
+part_select(Y,  18,  18) = 00000000000000000000000000000000000000000000000 (0)
+part_select(Y,  19,  36) = 00000000000000000000000000000010101010101010101 (15555)
+part_select(Y,  20,  34) = 00000000000000000000000000000000010101010101010 (2aaa)
+part_select(Y,  21,  37) = 00000000000000000000000000000010101010101010101 (15555)
+part_select(Y,  22,  18) = 00000000000000000000000000000000000000000001010 (a)
+part_select(Y,  23,  38) = 00000000000000000000000000000000101010101010101 (5555)
+part_select(Y,  24,  20) = 00000000000000000000000000000000000000000001010 (a)
+part_select(Y,  25,   1) = 00000000000000000000001010101010101010101010101 (1555555)
+part_select(Y,  26,  31) = 00000000000000000000000000000000000000000101010 (2a)
+part_select(Y,  27,  17) = 00000000000000000000000000000000000010101010101 (555)
+part_select(Y,  28,  20) = 00000000000000000000000000000000000000010101010 (aa)
+part_select(Y,  29,   6) = 00000000000000000000000010101010101010101010101 (555555)
+part_select(Y,  30,  27) = 00000000000000000000000000000000000000000001010 (a)
+part_select(Y,  31,  37) = 00000000000000000000000000000000000000001010101 (55)
+part_select(Y,  32,  11) = 00000000000000000000000001010101010101010101010 (2aaaaa)
+part_select(Y,  33,  24) = 00000000000000000000000000000000000000101010101 (155)
+part_select(Y,  34,  39) = 00000000000000000000000000000000000000000101010 (2a)
+part_select(Y,  35,   7) = 00000000000000000010101010101010101010101010101 (15555555)
+part_select(Y,  36,   3) = 00000000000001010101010101010101010101010101010 (2aaaaaaaa)
+part_select(Y,  37,   9) = 00000000000000000010101010101010101010101010101 (15555555)
+part_select(Y,  38,  36) = 00000000000000000000000000000000000000000000010 (2)
+part_select(Y,  39,  31) = 00000000000000000000000000000000000000101010101 (155)
+part_select(Y,  40,  16) = 00000000000000000000000101010101010101010101010 (aaaaaa)
+part_select(Y,  41,  46) = 00000000000000000000000000000000000000000010101 (15)
+part_select(Y,  42,  27) = 00000000000000000000000000000001010101010101010 (aaaa)
+part_select(Y,  43,  13) = 00000000000000001010101010101010101010101010101 (55555555)
+part_select(Y,  44,   6) = 00000000010101010101010101010101010101010101010 (2aaaaaaaaa)
+part_select(Y,  45,   9) = 00000000001010101010101010101010101010101010101 (1555555555)
+part_select(Y,  46,  13) = 00000000000001010101010101010101010101010101010 (2aaaaaaaa)
+ True: 01010101010101010101010101010101010101010101010 == 01010101010101010101010101010101010101010101010
 exit 0






More information about the llvm-commits mailing list