[llvm-commits] CVS: llvm/lib/Reoptimizer/BinInterface/bitmath.h sparc9.h
Joel Stanley
jstanley at cs.uiuc.edu
Thu Apr 10 15:32:01 PDT 2003
Changes in directory llvm/lib/Reoptimizer/BinInterface:
bitmath.h updated: 1.6 -> 1.7
sparc9.h updated: 1.10 -> 1.11
---
Log message:
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/BinInterface/bitmath.h
diff -u llvm/lib/Reoptimizer/BinInterface/bitmath.h:1.6 llvm/lib/Reoptimizer/BinInterface/bitmath.h:1.7
--- llvm/lib/Reoptimizer/BinInterface/bitmath.h:1.6 Thu Apr 10 00:33:56 2003
+++ llvm/lib/Reoptimizer/BinInterface/bitmath.h Thu Apr 10 15:32:49 2003
@@ -32,7 +32,7 @@
//*********************************
#define FLD_UPPER(FLD_DEF) (1 ? FLD_DEF)
#define FLD_LOWER(FLD_DEF) (0 ? FLD_DEF)
-#define MASKBELOW(V) ((1 << V) - 1)
+#define MASKBELOW(V) ((((uint64_t) 1) << V) - 1) // 64-bit '1' constant here to avoid overflow warnings
#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)))
Index: llvm/lib/Reoptimizer/BinInterface/sparc9.h
diff -u llvm/lib/Reoptimizer/BinInterface/sparc9.h:1.10 llvm/lib/Reoptimizer/BinInterface/sparc9.h:1.11
--- llvm/lib/Reoptimizer/BinInterface/sparc9.h:1.10 Thu Apr 10 00:33:56 2003
+++ llvm/lib/Reoptimizer/BinInterface/sparc9.h Thu Apr 10 15:32:49 2003
@@ -395,18 +395,24 @@
MK_FLD(INSTR_I, 1) | \
MK_FLD(INSTR_OP3, OP3_ADD))
-// Many of these macros can generate 'integer overflow in expression' warnings in some
-// cases (e.g., passing a numeric literal for an immediate field), and the root cause has
-// not yet been determined. FIXME.
-
// Construct immediate-valued logical operation
-#define MK_LOGIC_IMM(op3, dreg, sreg, imm) \
- (MK_FLD(INSTR_OP, OP_2) | \
- MK_FLD(INSTR_RD, dreg) | \
- MK_FLD(INSTR_RS1, sreg) | \
- MK_FLD(INSTR_SIMM13, imm) | \
- MK_FLD(INSTR_I, 1) | \
+#define MK_LOGIC_IMM(op3, dreg, sreg, imm) \
+ (MK_FLD(INSTR_OP, OP_2) | \
+ MK_FLD(INSTR_RD, dreg) | \
+ MK_FLD(INSTR_RS1, sreg) | \
+ MK_FLD(INSTR_SIMM13, imm) | \
+ MK_FLD(INSTR_I, 1) | \
+ MK_FLD(INSTR_OP3, op3))
+
+// Construct reg-to-reg logical operation
+
+#define MK_LOGIC(op3, dreg, sreg1, sreg2) \
+ (MK_FLD(INSTR_OP, OP_2) | \
+ MK_FLD(INSTR_RD, dreg) | \
+ MK_FLD(INSTR_RS1, sreg1) | \
+ MK_FLD(INSTR_RS2, sreg2) | \
+ MK_FLD(INSTR_I, 0) | \
MK_FLD(INSTR_OP3, op3))
// Construct sethi instruction
More information about the llvm-commits
mailing list