From patchwork Thu Feb 14 22:59:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10813969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA2A31390 for ; Thu, 14 Feb 2019 23:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98C592EE91 for ; Thu, 14 Feb 2019 23:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C6212EEF7; Thu, 14 Feb 2019 23:14:56 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC2702EE91 for ; Thu, 14 Feb 2019 23:14:55 +0000 (UTC) Received: from localhost ([127.0.0.1]:56485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guQDX-00079d-0f for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Feb 2019 18:14:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guQ8p-0003LF-13 for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:10:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guQ05-00055g-T4 for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:01:03 -0500 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:38702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guQ05-0004x7-Hd for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:01:01 -0500 Received: by mail-lf1-x142.google.com with SMTP id n15so5801457lfe.5 for ; Thu, 14 Feb 2019 15:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c6aI+CD9TMwU/Vx3ekjqo08GfwaEdLQRyzYXlaXcSKw=; b=G0vs3R+jIt7CGkAOf0hVL6dGoPhlPtuKOPN+zJ1X79l0aqogK7CY+vHR2FqiHNueeO +1d7jhNuYgni8FB/PrwmVLtV44Siur3EYhvl7v4NfwoIWUjipYvJ+zfVelPHMubZXZpa 3wvsrpAJnyFwPOqBdr1CK99JU8hH4BFtjhmvOfSOeYO1QpNHmffcTeRgvWmWD3QPoOEc MoUMbXUoi6lAdwSxSsyKaO0FucV3ziO05c/LnazjOIxO4clGGopojzgms2UO3na9VwOk 7W7fPg64h2FWajH6S6lNC/6IR1bE/h0PKDmOq/SaWzMMbiVjUlLxFafDZq9PkGIB06qu yb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c6aI+CD9TMwU/Vx3ekjqo08GfwaEdLQRyzYXlaXcSKw=; b=BsRwBY9Gloc4Rx7/1PTkpiD02sttHYQ3kg9zwtaawuIWRZTn3MzW8kVsH26HMMuiwW 3W0EDBxgPGHOTkVCPj+gOzRe1b2A4/Lhw+s7RSz75T5B2LT1QSgCJ9fdDc4mpI2j5QtV 1VmX5Pl40RCWGxqKQYetHbZLzjoTQmLoYPMKM0Q22vbh7DZHSuUwOUC7aMR6Opm9rKBi b6Ztlk+HQdYtI1JfnWXgWtHBUK6a0N75/kwq6JoTyu9Fzf9lAh74BAZPT/eZ94KRENWE NGrVbQGy07fFgTfJYKY8CJaHsSx5OmsKxeI4YFccq70OuK6QcUU4tjN4LWdDmX/B1B/1 j3Fw== X-Gm-Message-State: AHQUAubbQTWgvRcEjd8sxqEJWTflKycw4YYrxVnTmhULKbcq+9Z1Trup 9sruuimCVaO/6VGrd4+vTn1yw/or+2A= X-Google-Smtp-Source: AHgI3IbgU0sFzOhyEeDKSrS3m65YD0om0cGEs46apd7EDa+UJNBkOHPZdVt39wyFzryXJPfiYCjjbg== X-Received: by 2002:a19:9dd1:: with SMTP id g200mr3665526lfe.127.1550185248781; Thu, 14 Feb 2019 15:00:48 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id h123sm172384lfh.26.2019.02.14.15.00.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 15:00:48 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 14:59:51 -0800 Message-Id: <20190214230000.24894-5-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190214230000.24894-1-jcmvbkbc@gmail.com> References: <20190214230000.24894-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::142 Subject: [Qemu-devel] [PATCH 04/13] target/xtensa: implement wide branches and loops 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: , Cc: Max Filippov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP FLIX adds branch and loop instruction variants with 15- and 18-bit wide target offset. Implement them as additional names for the ordinary branch/loop opcodes. Signed-off-by: Max Filippov --- target/xtensa/translate.c | 129 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 102 insertions(+), 27 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 1b730781ec05..e8dddd32b3af 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2463,40 +2463,64 @@ static const XtensaOpcodeOps core_ops[] = { .translate = translate_all, .par = (const uint32_t[]){false, 8}, }, { - .name = "ball", + .name = (const char * const[]) { + "ball", "ball.w15", "ball.w18", NULL, + }, .translate = translate_ball, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bany", + .name = (const char * const[]) { + "bany", "bany.w15", "bany.w18", NULL, + }, .translate = translate_bany, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bbc", + .name = (const char * const[]) { + "bbc", "bbc.w15", "bbc.w18", NULL, + }, .translate = translate_bb, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bbci", + .name = (const char * const[]) { + "bbci", "bbci.w15", "bbci.w18", NULL, + }, .translate = translate_bbi, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bbs", + .name = (const char * const[]) { + "bbs", "bbs.w15", "bbs.w18", NULL, + }, .translate = translate_bb, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bbsi", + .name = (const char * const[]) { + "bbsi", "bbsi.w15", "bbsi.w18", NULL, + }, .translate = translate_bbi, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "beq", + .name = (const char * const[]) { + "beq", "beq.w15", "beq.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "beqi", + .name = (const char * const[]) { + "beqi", "beqi.w15", "beqi.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { .name = (const char * const[]) { - "beqz", "beqz.n", NULL, + "beqz", "beqz.n", "beqz.w15", "beqz.w18", NULL, }, .translate = translate_bz, .par = (const uint32_t[]){TCG_COND_EQ}, @@ -2506,68 +2530,110 @@ static const XtensaOpcodeOps core_ops[] = { .translate = translate_bp, .par = (const uint32_t[]){TCG_COND_EQ}, }, { - .name = "bge", + .name = (const char * const[]) { + "bge", "bge.w15", "bge.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_GE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bgei", + .name = (const char * const[]) { + "bgei", "bgei.w15", "bgei.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_GE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bgeu", + .name = (const char * const[]) { + "bgeu", "bgeu.w15", "bgeu.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_GEU}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bgeui", + .name = (const char * const[]) { + "bgeui", "bgeui.w15", "bgeui.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_GEU}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bgez", + .name = (const char * const[]) { + "bgez", "bgez.w15", "bgez.w18", NULL, + }, .translate = translate_bz, .par = (const uint32_t[]){TCG_COND_GE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "blt", + .name = (const char * const[]) { + "blt", "blt.w15", "blt.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_LT}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "blti", + .name = (const char * const[]) { + "blti", "blti.w15", "blti.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_LT}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bltu", + .name = (const char * const[]) { + "bltu", "bltu.w15", "bltu.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_LTU}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bltui", + .name = (const char * const[]) { + "bltui", "bltui.w15", "bltui.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_LTU}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bltz", + .name = (const char * const[]) { + "bltz", "bltz.w15", "bltz.w18", NULL, + }, .translate = translate_bz, .par = (const uint32_t[]){TCG_COND_LT}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bnall", + .name = (const char * const[]) { + "bnall", "bnall.w15", "bnall.w18", NULL, + }, .translate = translate_ball, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bne", + .name = (const char * const[]) { + "bne", "bne.w15", "bne.w18", NULL, + }, .translate = translate_b, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bnei", + .name = (const char * const[]) { + "bnei", "bnei.w15", "bnei.w18", NULL, + }, .translate = translate_bi, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { .name = (const char * const[]) { - "bnez", "bnez.n", NULL, + "bnez", "bnez.n", "bnez.w15", "bnez.w18", NULL, }, .translate = translate_bz, .par = (const uint32_t[]){TCG_COND_NE}, .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "bnone", + .name = (const char * const[]) { + "bnone", "bnone.w15", "bnone.w18", NULL, + }, .translate = translate_bany, .par = (const uint32_t[]){TCG_COND_EQ}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { .name = "break", .translate = translate_nop, @@ -2785,17 +2851,26 @@ static const XtensaOpcodeOps core_ops[] = { .name = "ldpte", .op_flags = XTENSA_OP_ILL, }, { - .name = "loop", + .name = (const char * const[]) { + "loop", "loop.w15", NULL, + }, .translate = translate_loop, .par = (const uint32_t[]){TCG_COND_NEVER}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "loopgtz", + .name = (const char * const[]) { + "loopgtz", "loopgtz.w15", NULL, + }, .translate = translate_loop, .par = (const uint32_t[]){TCG_COND_GT}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { - .name = "loopnez", + .name = (const char * const[]) { + "loopnez", "loopnez.w15", NULL, + }, .translate = translate_loop, .par = (const uint32_t[]){TCG_COND_NE}, + .op_flags = XTENSA_OP_NAME_ARRAY, }, { .name = "max", .translate = translate_smax,