[llvm-commits] CVS: llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h

Anand Shukla ashukla at cs.uiuc.edu
Sat May 31 17:17:11 PDT 2003


Changes in directory llvm/include/llvm/Reoptimizer/BinInterface:

bitmath.h updated: 1.8 -> 1.9

---
Log message:

First version of working bininterface API/implementation

---
Diffs of the changes:

Index: llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h
diff -u llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h:1.8 llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h:1.9
--- llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h:1.8	Tue Apr 22 18:01:06 2003
+++ llvm/include/llvm/Reoptimizer/BinInterface/bitmath.h	Sat May 31 17:16:41 2003
@@ -1,7 +1,6 @@
-//*****************************************************************************
-//
-//			   High Performance Bit Utility Functions
+//===--------llvm/Reoptimizer/BinInterface/bitmath.h--------------*- C++ -*--=//
 //
+// High Performance Bit Utility Functions
 // Contains
 //    * Routines for rounding to specific powers of 2
 //    * Bitfield access macros
@@ -12,15 +11,11 @@
 //    * Fast parity calculation
 //    * Fast log2 (for 32-bit numbers ONLY!)
 //
-//
-// 2002 Cameron Buschardt
-//*****************************************************************************
+//===----------------------------------------------------------------------===//
 
 #ifndef __BITMATH_H__
 #define __BITMATH_H__
 
-#include "Support/DataTypes.h"
-
 //*********************************
 //	Misc functions
 //*********************************
@@ -34,7 +29,7 @@
 //*********************************
 #define FLD_UPPER(FLD_DEF) (1 ? FLD_DEF)
 #define FLD_LOWER(FLD_DEF) (0 ? FLD_DEF)
-#define MASKBELOW(V)       ((((uint64_t) 1) << V) - 1) // 64-bit '1' constant here to avoid overflow warnings
+#define MASKBELOW(V)       ((1 << V) - 1)
 #define MASKEQBELOW(V)	   ((1 << V) | MASKBELOW(V)) //masks off everything ABOVE
 #define RD_FLD(x, FLD)     ((x & MASKEQBELOW(FLD_UPPER(FLD)))  >> FLD_LOWER(FLD))
 #define MK_FLD(FLD, val)   ((val << FLD_LOWER(FLD)) & MASKEQBELOW(FLD_UPPER(FLD)))
@@ -134,9 +129,7 @@
    return ((0xFFFFAA50 >> w) & 3)+n;   // this is a LUT
 }
 
-static unsigned LOW10(unsigned value)    { return value & 0x000003ff;       }
-static unsigned HIGH22(unsigned value)   { return value >> 10;              }
-static unsigned HIGHWORD(uint64_t value) { return (unsigned) (value >> 32); }
-static unsigned LOWWORD(uint64_t value)  { return (unsigned) value;         }
+
 
 #endif
+





More information about the llvm-commits mailing list