projects
/
cacao.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be74c77
)
Renamed x86_64_is_immxx to IS_IMMxx. Maybe these should be moved somewhere
author
twisti
<none@none>
Sun, 20 Mar 2005 16:25:33 +0000
(16:25 +0000)
committer
twisti
<none@none>
Sun, 20 Mar 2005 16:25:33 +0000
(16:25 +0000)
else.
src/vm/jit/x86_64/codegen.h
patch
|
blob
|
history
diff --git
a/src/vm/jit/x86_64/codegen.h
b/src/vm/jit/x86_64/codegen.h
index bb075217b1b3b5662dda8a6cdcc030ef339d998e..19fbf084d29b2ba27c0900172a052475f7755d70 100644
(file)
--- a/
src/vm/jit/x86_64/codegen.h
+++ b/
src/vm/jit/x86_64/codegen.h
@@
-1,4
+1,4
@@
-/*
vm/jit/x86_64/codegen.h - code generation macros and definition
s for x86_64
+/*
src/vm/jit/x86_64/codegen.h - code generation macro
s for x86_64
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
@@
-27,7
+27,7
@@
Authors: Andreas Krall
Christian Thalinger
Authors: Andreas Krall
Christian Thalinger
- $Id: codegen.h
1987 2005-03-05 15:42:1
3Z twisti $
+ $Id: codegen.h
2049 2005-03-20 16:25:3
3Z twisti $
*/
*/
@@
-102,6
+102,14
@@
typedef enum {
} X86_64_CC;
} X86_64_CC;
+#define IS_IMM8(imm) \
+ (((long) (imm) >= -128) && ((long) (imm) <= 127))
+
+
+#define IS_IMM32(imm) \
+ (((long) (imm) >= (-2147483647-1)) && ((long) (imm) <= 2147483647))
+
+
/* modrm and stuff */
#define x86_64_address_byte(mod,reg,rm) \
/* modrm and stuff */
#define x86_64_address_byte(mod,reg,rm) \
@@
-131,7
+139,7
@@
typedef enum {
if ((disp) == 0) { \
x86_64_address_byte(0,(dreg),REG_SP); \
x86_64_address_byte(0,REG_SP,REG_SP); \
if ((disp) == 0) { \
x86_64_address_byte(0,(dreg),REG_SP); \
x86_64_address_byte(0,REG_SP,REG_SP); \
- } else if (
x86_64_is_imm
8((disp))) { \
+ } else if (
IS_IMM
8((disp))) { \
x86_64_address_byte(1,(dreg),REG_SP); \
x86_64_address_byte(0,REG_SP,REG_SP); \
x86_64_emit_imm8((disp)); \
x86_64_address_byte(1,(dreg),REG_SP); \
x86_64_address_byte(0,REG_SP,REG_SP); \
x86_64_emit_imm8((disp)); \
@@
-153,7
+161,7
@@
typedef enum {
break; \
} \
\
break; \
} \
\
- if (
x86_64_is_imm
8((disp))) { \
+ if (
IS_IMM
8((disp))) { \
x86_64_address_byte(1,(dreg),(basereg)); \
x86_64_emit_imm8((disp)); \
} else { \
x86_64_address_byte(1,(dreg),(basereg)); \
x86_64_emit_imm8((disp)); \
} else { \
@@
-174,7
+182,7
@@
typedef enum {
x86_64_address_byte(0,(reg),4); \
x86_64_address_byte((scale),(indexreg),(basereg)); \
\
x86_64_address_byte(0,(reg),4); \
x86_64_address_byte((scale),(indexreg),(basereg)); \
\
- } else if (
x86_64_is_imm
8((disp))) { \
+ } else if (
IS_IMM
8((disp))) { \
x86_64_address_byte(1,(reg),4); \
x86_64_address_byte((scale),(indexreg),(basereg)); \
x86_64_emit_imm8 ((disp)); \
x86_64_address_byte(1,(reg),4); \
x86_64_address_byte((scale),(indexreg),(basereg)); \
x86_64_emit_imm8 ((disp)); \
@@
-187,14
+195,6
@@
typedef enum {
} while (0)
} while (0)
-#define x86_64_is_imm8(imm) \
- (((long)(imm) >= -128 && (long)(imm) <= 127))
-
-
-#define x86_64_is_imm32(imm) \
- ((long)(imm) >= (-2147483647-1) && (long)(imm) <= 2147483647)
-
-
#define x86_64_emit_imm8(imm) \
*(cd->mcodeptr++) = (u1) ((imm) & 0xff);
#define x86_64_emit_imm8(imm) \
*(cd->mcodeptr++) = (u1) ((imm) & 0xff);