From patchwork Mon Sep 2 17:54:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 272054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F1AEA2C00A3 for ; Tue, 3 Sep 2013 05:04:03 +1000 (EST) Received: from localhost ([::1]:41414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGYRn-00067t-Am for incoming@patchwork.ozlabs.org; Mon, 02 Sep 2013 14:01:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGYLg-0005xO-Gm for qemu-devel@nongnu.org; Mon, 02 Sep 2013 13:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGYLZ-000190-T2 for qemu-devel@nongnu.org; Mon, 02 Sep 2013 13:55:36 -0400 Received: from mail-pb0-x22c.google.com ([2607:f8b0:400e:c01::22c]:57645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGYLZ-000187-HJ for qemu-devel@nongnu.org; Mon, 02 Sep 2013 13:55:29 -0400 Received: by mail-pb0-f44.google.com with SMTP id xa7so4988067pbc.31 for ; Mon, 02 Sep 2013 10:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=XXH8gdjJnVnQwFEZR58TYdKmtYRPSczW4/fRBc1bwxE=; b=Bcyizwx4qIB0a5EUx7Zey29SrDXkBIGzFt0H1yk9t636A/9oeVGdHOQyt8TVkPCNFI erEb8IEoV6bOzK4sDVbusVry7DE+MZJvZL7+zTO/rMB+vKl7LtRcz+E3iTUv/8TWjv/1 uYqqyhCFaztb6TvSRyhzEpHb1/Z7EuQYOsUtliPhz8S+Nebhf9mHTJjnjsbxyTekg9vT 0OhdxGM0Z2JhyiPBw1BmKXxOzZeanQaaJT7guLEm1LP+YLUHoB9+6OQ1EC6RZCyODLow 4xwxZKtBanj1LqSEl30y/oJBMd/BUdwb60OVOKC+mAuXJ1WbN752Lc3pMv/Yfey9KFaX 5WeQ== X-Received: by 10.68.143.131 with SMTP id se3mr26635652pbb.39.1378144528517; Mon, 02 Sep 2013 10:55:28 -0700 (PDT) Received: from pebble.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id tr10sm17218114pbc.22.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Sep 2013 10:55:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 2 Sep 2013 10:54:46 -0700 Message-Id: <1378144503-15808-13-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378144503-15808-1-git-send-email-rth@twiddle.net> References: <1378144503-15808-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22c Cc: claudio.fontana@huawei.com, Richard Henderson Subject: [Qemu-devel] [PATCH v3 12/29] tcg-aarch64: Support andc, orc, eqv, not X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c | 65 ++++++++++++++++++++++++++++++++++++++++++------ tcg/aarch64/tcg-target.h | 16 ++++++------ 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c index 9324185..eb080ed 100644 --- a/tcg/aarch64/tcg-target.c +++ b/tcg/aarch64/tcg-target.c @@ -253,10 +253,12 @@ typedef enum { INSN_EORI = 0x52000000, /* Logical shifted register instructions */ - INSN_AND = 0x0a000000, - INSN_ORR = 0x2a000000, - INSN_EOR = 0x4a000000, - INSN_ANDS = 0x6a000000, + INSN_AND = 0x0a000000, + INSN_BIC = 0x0a200000, + INSN_ORR = 0x2a000000, + INSN_ORN = 0x2a200000, + INSN_EOR = 0x4a000000, + INSN_EON = 0x4a200000, /* Add/subtract immediate instructions */ INSN_ADDI = 0x11000000, @@ -265,10 +267,10 @@ typedef enum { INSN_SUBSI = 0x71000000, /* Add/subtract shifted register instructions */ - INSN_ADD = 0x0b000000, - INSN_ADDS = 0x2b000000, - INSN_SUB = 0x4b000000, - INSN_SUBS = 0x6b000000, + INSN_ADD = 0x0b000000, + INSN_ADDS = 0x2b000000, + INSN_SUB = 0x4b000000, + INSN_SUBS = 0x6b000000, /* Data-processing (2 source) instructions */ INSN_LSLV = 0x1ac02000, @@ -1250,6 +1252,17 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; + case INDEX_op_andc_i32: + a2 = (int32_t)a2; + /* FALLTHRU */ + case INDEX_op_andc_i64: + if (c2) { + tcg_fmt_Rdn_limm(s, INSN_ANDI, ext, a0, a1, ~a2); + } else { + tcg_fmt_Rdnm(s, INSN_BIC, ext, a0, a1, a2); + } + break; + case INDEX_op_or_i32: a2 = (int32_t)a2; /* FALLTHRU */ @@ -1261,6 +1274,17 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; + case INDEX_op_orc_i32: + a2 = (int32_t)a2; + /* FALLTHRU */ + case INDEX_op_orc_i64: + if (c2) { + tcg_fmt_Rdn_limm(s, INSN_ORRI, ext, a0, a1, ~a2); + } else { + tcg_fmt_Rdnm(s, INSN_ORN, ext, a0, a1, a2); + } + break; + case INDEX_op_xor_i32: a2 = (int32_t)a2; /* FALLTHRU */ @@ -1272,6 +1296,22 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; + case INDEX_op_eqv_i32: + a2 = (int32_t)a2; + /* FALLTHRU */ + case INDEX_op_eqv_i64: + if (c2) { + tcg_fmt_Rdn_limm(s, INSN_EORI, ext, a0, a1, ~a2); + } else { + tcg_fmt_Rdnm(s, INSN_EON, ext, a0, a1, a2); + } + break; + + case INDEX_op_not_i64: + case INDEX_op_not_i32: + tcg_fmt_Rdnm(s, INSN_ORN, ext, a0, TCG_REG_XZR, a1); + break; + case INDEX_op_mul_i64: case INDEX_op_mul_i32: tcg_out_mul(s, ext, a0, a1, a2); @@ -1468,6 +1508,15 @@ static const TCGTargetOpDef aarch64_op_defs[] = { { INDEX_op_or_i64, { "r", "r", "rL" } }, { INDEX_op_xor_i32, { "r", "r", "rwL" } }, { INDEX_op_xor_i64, { "r", "r", "rL" } }, + { INDEX_op_andc_i32, { "r", "r", "rwL" } }, + { INDEX_op_andc_i64, { "r", "r", "rL" } }, + { INDEX_op_orc_i32, { "r", "r", "rwL" } }, + { INDEX_op_orc_i64, { "r", "r", "rL" } }, + { INDEX_op_eqv_i32, { "r", "r", "rwL" } }, + { INDEX_op_eqv_i64, { "r", "r", "rL" } }, + + { INDEX_op_not_i32, { "r", "r" } }, + { INDEX_op_not_i64, { "r", "r" } }, { INDEX_op_shl_i32, { "r", "r", "ri" } }, { INDEX_op_shr_i32, { "r", "r", "ri" } }, diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 26ee28b..6242136 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -47,12 +47,12 @@ typedef enum { #define TCG_TARGET_HAS_ext16u_i32 1 #define TCG_TARGET_HAS_bswap16_i32 1 #define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 0 +#define TCG_TARGET_HAS_not_i32 1 #define TCG_TARGET_HAS_neg_i32 0 #define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_andc_i32 0 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 1 #define TCG_TARGET_HAS_nand_i32 0 #define TCG_TARGET_HAS_nor_i32 0 #define TCG_TARGET_HAS_deposit_i32 0 @@ -75,12 +75,12 @@ typedef enum { #define TCG_TARGET_HAS_bswap16_i64 1 #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 0 +#define TCG_TARGET_HAS_not_i64 1 #define TCG_TARGET_HAS_neg_i64 0 #define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 #define TCG_TARGET_HAS_nand_i64 0 #define TCG_TARGET_HAS_nor_i64 0 #define TCG_TARGET_HAS_deposit_i64 0