From patchwork Fri Aug 4 05:44:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9880587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6DBE60360 for ; Fri, 4 Aug 2017 05:51:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BECAE2899A for ; Fri, 4 Aug 2017 05:51:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3A9C289A6; Fri, 4 Aug 2017 05:51:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C4E22899A for ; Fri, 4 Aug 2017 05:51:25 +0000 (UTC) Received: from localhost ([::1]:36678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddVW8-0000FW-Jd for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Aug 2017 01:51:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddVPm-00047n-Pv for qemu-devel@nongnu.org; Fri, 04 Aug 2017 01:44:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddVPj-0003h8-IC for qemu-devel@nongnu.org; Fri, 04 Aug 2017 01:44:50 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:37865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddVPj-0003fq-DM for qemu-devel@nongnu.org; Fri, 04 Aug 2017 01:44:47 -0400 Received: by mail-pf0-x243.google.com with SMTP id p13so862179pfd.4 for ; Thu, 03 Aug 2017 22:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=GUbINzV3agUVGHQrOdgBqlgaI7Rdgw1Uy/To7ET+TCE=; b=MivKAJ939i9/Z4VTdLIhFd8n5odvMrTswZnEPxXSsEHtgzWFkQ9JnoJlQvHxNwR8q4 EeM8VydEArLLH5YZkgVESKC2e72FDwCwZXQBlO1goZU9moPuGF15bSlK1urXBoV9UXvi Z3jLOM/T88FU1VLDHbD9L7TEu/1mYfkRwkWZs4l/YM3YNBqghqmQhqff44Zk05dJYjBe 07aCquLymUqRKBw/yE0xXQ7OYAVaPf3jUQI8EPJdS/GQcJ2yqvBw+TtZmGagsRi0lBWZ DfHnvXDWMEi50iD21QnJz2YiVDb8jFdMYj1Ex+vwAZjIiCzKWXfleffGnI3Drz4bMEHC mPsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=GUbINzV3agUVGHQrOdgBqlgaI7Rdgw1Uy/To7ET+TCE=; b=VbfbjwlkTcfDbKIvg2iM4PL72+iTVyJlH6ewWOZEr8Pkw6ejr/cKnQvf3dgre5Xosd 3/f4IO2moJhor8PMEcMBUCzrP1qzQWZrTIOflKM9brlbdNbYw/HFAhFre7G6CbFJVtMr U2cQTuLfbIVQaC774UvVSBXr4RnI+8oSJjq+0PMvAm3dd6mBGeupKKDarQTEkoVPksTE EqgwwK3PuuZl9JEHxfmMAv38/tqvy/1jfmd4sHj//Ea3XsGrbbGa4rsJnjdSQOwdo8cU X01FJ1C9zci2MJgTvbCeTOJl+FtwPhUa3OFZh8xI/NILjlyPX1lNIPcNCTSz4auPG0Hh j2uQ== X-Gm-Message-State: AIVw113gOotrokwGgrmq4ZYov/dXNQDgPK2UmtYrhiOc0KK4VWNTFuWI NqjI+PHg2LSwPMXxjk4= X-Received: by 10.84.218.66 with SMTP id f2mr1398595plm.206.1501825486327; Thu, 03 Aug 2017 22:44:46 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id o14sm1061063pfi.158.2017.08.03.22.44.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Aug 2017 22:44:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 3 Aug 2017 22:44:21 -0700 Message-Id: <20170804054426.10590-19-rth@twiddle.net> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170804054426.10590-1-rth@twiddle.net> References: <20170804054426.10590-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH for-2.11 18/23] tcg/arm: Extract INSN_NOP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We'll want this for tcg_out_nop_fill. Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index f40e87066f..78603a19db 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -160,8 +160,18 @@ typedef enum { INSN_DMB_ISH = 0x5bf07ff5, INSN_DMB_MCR = 0xba0f07ee, + + /* Architected nop introduced in v6k. */ + /* ??? This is an MSR (imm) 0,0,0 insn. Anyone know if this + also Just So Happened to do nothing on pre-v6k so that we + don't need to conditionalize it? */ + INSN_NOP_v6k = 0xe320f000, + /* Otherwise the assembler uses mov r0,r0 */ + INSN_NOP_v4 = (COND_AL << 28) | ARITH_MOV, } ARMInsn; +#define INSN_NOP (use_armv7_instructions ? INSN_NOP_v6k : INSN_NOP_v4) + static const uint8_t tcg_cond_to_arm_cond[] = { [TCG_COND_EQ] = COND_EQ, [TCG_COND_NE] = COND_NE, @@ -375,16 +385,7 @@ static inline void tcg_out_dat_reg(TCGContext *s, static inline void tcg_out_nop(TCGContext *s) { - if (use_armv7_instructions) { - /* Architected nop introduced in v6k. */ - /* ??? This is an MSR (imm) 0,0,0 insn. Anyone know if this - also Just So Happened to do nothing on pre-v6k so that we - don't need to conditionalize it? */ - tcg_out32(s, 0xe320f000); - } else { - /* Prior to that the assembler uses mov r0, r0. */ - tcg_out_dat_reg(s, COND_AL, ARITH_MOV, 0, 0, 0, SHIFT_IMM_LSL(0)); - } + tcg_out32(s, INSN_NOP); } static inline void tcg_out_mov_reg(TCGContext *s, int cond, int rd, int rm)