From 74425e2612217826ae614ae8e7cc1dc8c46427f0 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 24 Mar 2006 18:21:11 +0000 Subject: [PATCH] create sub esp, imm instead off add esp -imm instructions --- ir/be/ia32/ia32_emitter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 084dc8ffe..a072268b4 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -1186,12 +1186,14 @@ void emit_be_Call(const ir_node *irn, ia32_emit_env_t *emit_env) { void emit_be_IncSP(const ir_node *irn, ia32_emit_env_t *emit_env) { FILE *F = emit_env->out; unsigned offs = be_get_IncSP_offset(irn); - be_stack_dir_t dir = be_get_IncSP_direction(irn); char cmd_buf[SNPRINTF_BUF_LEN], cmnt_buf[SNPRINTF_BUF_LEN]; if (offs) { - lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "add %1S,%s%u", irn, - (dir == be_stack_dir_along) ? " -" : " ", offs); + be_stack_dir_t dir = be_get_IncSP_direction(irn); + if (dir == be_stack_dir_along) + lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "sub %1S, %u", irn, offs); + else + lc_esnprintf(ia32_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "add %1S, %u", irn, offs); lc_esnprintf(ia32_get_arg_env(), cmnt_buf, SNPRINTF_BUF_LEN, "/* %+F (IncSP) */", irn); } else { -- 2.20.1