pike.git/
src/
code/
amd64.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-12-04
2014-12-04 19:27:04 by Per Hedbor <ph@opera.com>
b8709fbae6ac1e7e401cd00c8bc566e58aa66598 (
23
lines) (+
12
/-
11
)
[
Show
|
Annotate
]
Branch:
bill/master_archive_support
Generate more compact code for int+int.
1717:
{ ins_debug_instr_prologue(b, 0, 0); amd64_load_sp_reg();
-
mov_
mem8
_reg( sp_reg, -sizeof(struct svalue)*2, P_REG_RAX );
-
shl
_reg_
imm
( P_REG_RAX,
8 );
-
mov_mem8_reg(
sp_reg,-sizeof(struct svalue)
,
P_REG_RBX
);
-
/* and
_
reg
_
imm(
P_REG_RBX,
0x1f );*/
-
add
_
reg
_
reg(
P_REG_RAX,
P_REG_RBX );
-
/*
and
_
reg
_imm( P_REG_RAX,
0x1f1f
); */
-
cmp_reg32_imm( P_REG_RAX, (PIKE_T_INT<<8)|PIKE_T_INT );
-
jne
( &label_A );
+
mov_
mem
_reg( sp_reg, -sizeof(struct svalue)*2, P_REG_RAX );
+
add
_reg_
mem
( P_REG_RAX, sp_reg,
-sizeof(struct svalue
) );
+
#if
PIKE
_
T
_
INT
!=
0
+
#error
This
code
assumes
PIKE
_
T
_
INT
is
0.
+
/*
cmp
_
reg32
_imm( P_REG_RAX,
0
); */
+
#endif
+
jnz
( &label_A );
/* So. Both are actually integers. */ mov_mem_reg( sp_reg, -sizeof(struct svalue)+OFFSETOF(svalue,u.integer),
1732:
add_reg_mem( P_REG_RAX, sp_reg,
-
-sizeof(struct svalue)*2+OFFSETOF(svalue,u.integer)
-
);
+
-sizeof(struct svalue)*2+OFFSETOF(svalue,u.integer));
jo( &label_A ); amd64_add_sp( -1 );
-
mov_imm_mem(
PIKE_T_INT
,
sp_reg,
-sizeof(struct
svalue));
+
/*
the type only needs to be set if the subtype was set before.
+
It was not
,
since
the type check before would not have
+
triggered. */
mov_reg_mem( P_REG_RAX, sp_reg, -sizeof(struct svalue)+OFFSETOF(svalue,u.integer)); jmp( &label_B );