From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6PXq-0004ds-H9 for qemu-devel@nongnu.org; Mon, 05 Aug 2013 14:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6PXk-0001cD-Lu for qemu-devel@nongnu.org; Mon, 05 Aug 2013 14:30:14 -0400 Received: from mail-qa0-x234.google.com ([2607:f8b0:400d:c00::234]:50059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6PXk-0001bL-Fa for qemu-devel@nongnu.org; Mon, 05 Aug 2013 14:30:08 -0400 Received: by mail-qa0-f52.google.com with SMTP id bq6so1149056qab.4 for ; Mon, 05 Aug 2013 11:30:08 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 5 Aug 2013 08:28:48 -1000 Message-Id: <1375727330-30515-14-git-send-email-rth@twiddle.net> In-Reply-To: <1375727330-30515-1-git-send-email-rth@twiddle.net> References: <1375727330-30515-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH for-next 13/15] tcg-ppc64: Tidy tcg_target_qemu_prologue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Vassili Karpov (malc)" , Richard Henderson Use the helper macros like TAI. Fix formatting. Signed-off-by: Richard Henderson --- tcg/ppc64/tcg-target.c | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index d4e1efc..90d033c 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -1118,21 +1118,18 @@ static void tcg_target_qemu_prologue (TCGContext *s) #endif /* Prologue */ - tcg_out32 (s, MFSPR | RT (0) | LR); - tcg_out32 (s, STDU | RS (1) | RA (1) | (-frame_size & 0xffff)); - for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i) - tcg_out32 (s, (STD - | RS (tcg_target_callee_save_regs[i]) - | RA (1) - | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE) - ) - ); - tcg_out32 (s, STD | RS (0) | RA (1) | (frame_size + 16)); + tcg_out32(s, MFSPR | RT(TCG_REG_R0) | LR); + tcg_out32(s, STDU | SAI(TCG_REG_R1, TCG_REG_R1, -frame_size)); + for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i) { + tcg_out32(s, (STD | SAI(tcg_target_callee_save_regs[i], TCG_REG_R1, + i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE))); + } + tcg_out32(s, STD | RS(TCG_REG_R0) | RA(TCG_REG_R1) | (frame_size + 16)); #ifdef CONFIG_USE_GUEST_BASE if (GUEST_BASE) { - tcg_out_movi (s, TCG_TYPE_I64, TCG_GUEST_BASE_REG, GUEST_BASE); - tcg_regset_set_reg (s->reserved_regs, TCG_GUEST_BASE_REG); + tcg_out_movi(s, TCG_TYPE_I64, TCG_GUEST_BASE_REG, GUEST_BASE); + tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); } #endif @@ -1144,16 +1141,13 @@ static void tcg_target_qemu_prologue (TCGContext *s) /* Epilogue */ tb_ret_addr = s->code_ptr; - for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i) - tcg_out32 (s, (LD - | RT (tcg_target_callee_save_regs[i]) - | RA (1) - | (i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE) - ) - ); - tcg_out32(s, LD | TAI(0, 1, frame_size + 16)); - tcg_out32(s, MTSPR | RS(0) | LR); - tcg_out32(s, ADDI | TAI(1, 1, frame_size)); + tcg_out32(s, LD | TAI(TCG_REG_R0, TCG_REG_R1, frame_size + 16)); + for (i = 0; i < ARRAY_SIZE (tcg_target_callee_save_regs); ++i) { + tcg_out32(s, (LD | TAI(tcg_target_callee_save_regs[i], TCG_REG_R1, + i * 8 + 48 + TCG_STATIC_CALL_ARGS_SIZE))); + } + tcg_out32(s, MTSPR | RS(TCG_REG_R0) | LR); + tcg_out32(s, ADDI | TAI(TCG_REG_R1, TCG_REG_R1, frame_size)); tcg_out32(s, BCLR | BO_ALWAYS); } -- 1.8.3.1