From patchwork Thu May 23 12:00:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 17117 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF6CA25E1D for ; Thu, 23 May 2013 12:01:09 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id x16sf2324316vbf.10 for ; Thu, 23 May 2013 05:00:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=rm3S3m2PUpir8mw2pN8Tci4HsSp68FVV5dMRN1HpgQs=; b=HZkwuF3t+3Qq+R+ApYzhYItVraDR4qG0nUnfcs3drnvL2cozyir8cKNuuDzFo7q08g nvO6p/dg9BMB2y6bM7hhUlO63le7841SWalx1Q42B9b245dW/4cnfvWq6X2b7QNMl7n4 84D4PbdnZsbQdbr7PH7qrv34SnCC/883lhpsC4rzjnlETaYt9yROTmWkgvfdzAKRA3I5 8iMWbp+DH9M9/hzU89n5QN/xK0AiSUgBeauZIA0dxoNq4egMm4q2qnHLBi62JwMIS2Qt zekMaIL3Jfd/idC6Zbj9TqRbdUaKNcnX34NFO8nB1JdBdB2jNd34lBAo6VtNMdr+E2Ua yPLQ== X-Received: by 10.236.189.241 with SMTP id c77mr6294186yhn.17.1369310414622; Thu, 23 May 2013 05:00:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.35 with SMTP id dp3ls1436147qeb.87.gmail; Thu, 23 May 2013 05:00:14 -0700 (PDT) X-Received: by 10.52.233.34 with SMTP id tt2mr4176820vdc.70.1369310414435; Thu, 23 May 2013 05:00:14 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id p8si6124677vdv.83.2013.05.23.05.00.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 05:00:14 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id cz11so2271134veb.20 for ; Thu, 23 May 2013 05:00:14 -0700 (PDT) X-Received: by 10.52.176.65 with SMTP id cg1mr4236097vdc.1.1369310414278; Thu, 23 May 2013 05:00:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp47546vcs; Thu, 23 May 2013 05:00:13 -0700 (PDT) X-Received: by 10.14.107.200 with SMTP id o48mr30813563eeg.35.1369310410101; Thu, 23 May 2013 05:00:10 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id z48si15459105een.7.2013.05.23.05.00.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 05:00:10 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UfUBg-0001Nu-Gl; Thu, 23 May 2013 13:00:04 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Richard Henderson , John Rigby , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Blue Swirl , Aurelien Jarno Subject: [PATCH 07/10] target-arm: Remove gen_{ld,st}* from Thumb insns Date: Thu, 23 May 2013 13:00:01 +0100 Message-Id: <1369310404-5285-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1369310404-5285-1-git-send-email-peter.maydell@linaro.org> References: <1369310404-5285-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnmnRDJ4SsbDWbzYK7CieTpOyYWJyLTekv8zYDh+DeTzlMpM8GhsJ+d6H7tMSdIACtIOefc X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Peter Maydell --- target-arm/translate.c | 71 +++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index e5a2e4c..953c5fb 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -9217,7 +9217,8 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) val &= ~(uint32_t)2; addr = tcg_temp_new_i32(); tcg_gen_movi_i32(addr, val); - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); tcg_temp_free_i32(addr); store_reg(s, rd, tmp); break; @@ -9412,37 +9413,43 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) tcg_gen_add_i32(addr, addr, tmp); tcg_temp_free_i32(tmp); - if (op < 3) /* store */ + if (op < 3) { /* store */ tmp = load_reg(s, rd); + } else { + tmp = tcg_temp_new_i32(); + } switch (op) { case 0: /* str */ - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); break; case 1: /* strh */ - gen_st16(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st16(tmp, addr, IS_USER(s)); break; case 2: /* strb */ - gen_st8(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st8(tmp, addr, IS_USER(s)); break; case 3: /* ldrsb */ - tmp = gen_ld8s(addr, IS_USER(s)); + tcg_gen_qemu_ld8s(tmp, addr, IS_USER(s)); break; case 4: /* ldr */ - tmp = gen_ld32(addr, IS_USER(s)); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); break; case 5: /* ldrh */ - tmp = gen_ld16u(addr, IS_USER(s)); + tcg_gen_qemu_ld16u(tmp, addr, IS_USER(s)); break; case 6: /* ldrb */ - tmp = gen_ld8u(addr, IS_USER(s)); + tcg_gen_qemu_ld8u(tmp, addr, IS_USER(s)); break; case 7: /* ldrsh */ - tmp = gen_ld16s(addr, IS_USER(s)); + tcg_gen_qemu_ld16s(tmp, addr, IS_USER(s)); break; } - if (op >= 3) /* load */ + if (op >= 3) { /* load */ store_reg(s, rd, tmp); + } else { + tcg_temp_free_i32(tmp); + } tcg_temp_free_i32(addr); break; @@ -9456,12 +9463,14 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << 11)) { /* load */ - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); store_reg(s, rd, tmp); } else { /* store */ tmp = load_reg(s, rd); - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } tcg_temp_free_i32(addr); break; @@ -9476,12 +9485,14 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << 11)) { /* load */ - tmp = gen_ld8u(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld8u(tmp, addr, IS_USER(s)); store_reg(s, rd, tmp); } else { /* store */ tmp = load_reg(s, rd); - gen_st8(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st8(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } tcg_temp_free_i32(addr); break; @@ -9496,12 +9507,14 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << 11)) { /* load */ - tmp = gen_ld16u(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld16u(tmp, addr, IS_USER(s)); store_reg(s, rd, tmp); } else { /* store */ tmp = load_reg(s, rd); - gen_st16(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st16(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } tcg_temp_free_i32(addr); break; @@ -9515,12 +9528,14 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << 11)) { /* load */ - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); store_reg(s, rd, tmp); } else { /* store */ tmp = load_reg(s, rd); - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } tcg_temp_free_i32(addr); break; @@ -9586,12 +9601,14 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << i)) { if (insn & (1 << 11)) { /* pop */ - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); store_reg(s, i, tmp); } else { /* push */ tmp = load_reg(s, i); - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } /* advance to the next address. */ tcg_gen_addi_i32(addr, addr, 4); @@ -9601,13 +9618,15 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << 8)) { if (insn & (1 << 11)) { /* pop pc */ - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); /* don't set the pc until the rest of the instruction has completed */ } else { /* push lr */ tmp = load_reg(s, 14); - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } tcg_gen_addi_i32(addr, addr, 4); } @@ -9730,7 +9749,8 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) if (insn & (1 << i)) { if (insn & (1 << 11)) { /* load */ - tmp = gen_ld32(addr, IS_USER(s)); + tmp = tcg_temp_new_i32(); + tcg_gen_qemu_ld32u(tmp, addr, IS_USER(s)); if (i == rn) { loaded_var = tmp; } else { @@ -9739,7 +9759,8 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) } else { /* store */ tmp = load_reg(s, i); - gen_st32(tmp, addr, IS_USER(s)); + tcg_gen_qemu_st32(tmp, addr, IS_USER(s)); + tcg_temp_free_i32(tmp); } /* advance to the next address */ tcg_gen_addi_i32(addr, addr, 4);