[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h

Reid Spencer reid at x10sys.com
Tue May 1 19:35:43 PDT 2007



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

bits.h updated: 1.4 -> 1.5
---
Log message:

Add some bit widths.
Make conversion from hex string easier.


---
Diffs of the changes:  (+9 -1)

 bits.h |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)


Index: llvm-test/SingleSource/UnitTests/Integer/bits.h
diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.4 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.5
--- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.4	Sat Apr 21 12:47:59 2007
+++ llvm-test/SingleSource/UnitTests/Integer/bits.h	Tue May  1 21:35:26 2007
@@ -40,12 +40,14 @@
 typedef unsigned int __attribute__((bitwidth(68))) uint68;
 typedef unsigned int __attribute__((bitwidth(128))) uint128;
 
-typedef int __attribute__ ((bitwidth(9))) int9;
+typedef int __attribute__((bitwidth(9)))  int9;
 typedef int __attribute__((bitwidth(10))) int10;
 typedef int __attribute__((bitwidth(21))) int21;
 typedef int __attribute__((bitwidth(24))) int24;
 typedef int __attribute__((bitwidth(32))) int32;
 typedef int __attribute__((bitwidth(33))) int33;
+typedef int __attribute__((bitwidth(68))) int68;
+typedef int __attribute__((bitwidth(69))) int69;
 
 typedef int __attribute__((bitwidth(169))) int169;
 typedef unsigned int __attribute__((bitwidth(250))) int250;
@@ -111,3 +113,9 @@
   __builtin_bit_from_string(&Result, str, 10); \
   Result; \
 })
+
+#define bitsFromHexString(str,bits) ({ \
+  int __attribute__((bitwidth(bits))) Result; \
+  __builtin_bit_from_string(&Result, str, 16); \
+  Result; \
+})






More information about the llvm-commits mailing list