Commit 219d2eb2 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

8bit immediates of Push are signed.

[r26616]
parent bb7f61c1
......@@ -2393,22 +2393,6 @@ static void bemit_modru(const arch_register_t *reg, unsigned ext)
bemit8(modrm);
}
/**
* Calculate the size of an (unsigned) immediate in bytes.
*
* @param offset an offset
*/
static unsigned get_unsigned_imm_size(unsigned offset)
{
if (offset < 256) {
return 1;
} else if (offset < 65536) {
return 2;
} else {
return 4;
}
}
/**
* Calculate the size of an signed immediate in bytes.
*
......@@ -3074,7 +3058,7 @@ static void bemit_push(const ir_node *node)
if (is_ia32_Immediate(value)) {
const ia32_immediate_attr_t *attr
= get_ia32_immediate_attr_const(value);
unsigned size = get_unsigned_imm_size(attr->offset);
unsigned size = get_signed_imm_size(attr->offset);
if (attr->symconst)
size = 4;
switch (size) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment