From patchwork Tue Feb 19 06:10:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10819287 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 222261390 for ; Tue, 19 Feb 2019 06:22:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2C22B50F for ; Tue, 19 Feb 2019 06:22:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F09042B541; Tue, 19 Feb 2019 06:22:06 +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 96A322B50F for ; Tue, 19 Feb 2019 06:22:06 +0000 (UTC) Received: from localhost ([127.0.0.1]:42466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvyn7-0004Og-Nv for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 01:22:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvydV-0005EU-A5 for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvydU-00073i-4g for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:09 -0500 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:35132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvydT-00073W-K0 for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:07 -0500 Received: by mail-lf1-x143.google.com with SMTP id v7so14039149lfd.2 for ; Mon, 18 Feb 2019 22:12:07 -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=P2u49sCBk37KoNN8fPskONIbW+KnBeOzRLO6MU5PE0k=; b=orC7cf6w0BnQ5sDeOc4A5yFGx2Ril0+mp+TTM/tsKc9jnk5P9qbEdQsiC32uXnksMQ 6jhy0snEbZ1w9WLykxtlCuBiYnIhDDhk/bh1a1ntwHwdi7H4AS4/dDryUtHn3Pq2Qd5p bUfHmyL7uTvNX7Y7Rpurgo0BdOXllNT2UUgqnab6KqJ/IidLufpUft7mbe3+tcrdZ0kc z2crnUge4Dwp5RAWNjC2k+a9heciCDkWBpUo669QW7J619Zbkeqr/Yf6I8Ui7F06YbQA OwatLJvSZn612P94DtyOfJugWS2sx2R8md+pyA2nYD6qQFj0SU1oCJjqI9BNBX5swiOR 2q+Q== 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=P2u49sCBk37KoNN8fPskONIbW+KnBeOzRLO6MU5PE0k=; b=fLUj4VrWw8Jc2fL7SnTmEK4L/SnJm/1zsE+Bn++7fBXzXb5lXVONlVp+TSFnAqtkwy KKGUEsSuznZ4Yi1FEyN1/hdxl5sOQJKp/e88cAlN0BylpPKM9qB/b7XUHyyU55pnL465 AJuF/By1nplf4pOBLv5VUrody/rpKoTXYslgUJEYBFGzGf3BdCge3uIAVLS7jA59NrQk K/PxSNd3DqnMXMNT4s+G5Ufz72rieHYHueVpV7BKrWJOnQ5yyRDWg/3yDUDPfVL9EL9U xwwNRvhMUMkSBeT84z3OSkoY+Wb7Vg8mFKcPMOFxpftbBNgrukMsOgm0bhEpP4WXBF/9 ReFQ== X-Gm-Message-State: AHQUAuav8R7wXps43v68f3/xuvdhAX/Wx7wiZOD9rPa+HE7PVmMPLIw+ 7Ynb+QciQM9wTf6Ad84dPnPAFHaO8KQ= X-Google-Smtp-Source: AHgI3Ia3BCdsGh7H+sy0Y7INjlPiA7cYyYVQOrapYrdOiy16BzUJiuRjTO2RO00W0lKHen+Qm46Weg== X-Received: by 2002:ac2:5288:: with SMTP id q8mr16788307lfm.157.1550556726133; Mon, 18 Feb 2019 22:12:06 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f16-v6sm4235745lji.88.2019.02.18.22.12.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 22:12:05 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 22:10:54 -0800 Message-Id: <20190219061111.10231-7-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190219061111.10231-1-jcmvbkbc@gmail.com> References: <20190219061111.10231-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::143 Subject: [Qemu-devel] [PATCH 06/23] tests/tcg/xtensa: fix endianness issues in test_b 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use bbci.l/bbsi.l instead of bbci/bbsi, as they are assembly macros that accept little-endian bit number and produce correct immediate for both little and big endian configurations. Choose value loaded into register for bbc/bbs opcodes based on configuration endianness. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_b.S | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tests/tcg/xtensa/test_b.S b/tests/tcg/xtensa/test_b.S index 8e81f956df84..713a454c535b 100644 --- a/tests/tcg/xtensa/test_b.S +++ b/tests/tcg/xtensa/test_b.S @@ -84,12 +84,24 @@ test_end test bbc movi a2, 0xfffffffd - movi a3, 0xffffff01 +#undef BIT +#if XCHAL_HAVE_BE +#define BIT 0xfffffffe +#else +#define BIT 0xffffff01 +#endif + movi a3, BIT bbc a2, a3, 1f test_fail 1: movi a2, 8 - movi a3, 0xffffff03 +#undef BIT +#if XCHAL_HAVE_BE +#define BIT 0xfffffffc +#else +#define BIT 0xffffff03 +#endif + movi a3, BIT bbc a2, a3, 1f j 2f 1: @@ -99,11 +111,11 @@ test_end test bbci movi a2, 0xfffdffff - bbci a2, 17, 1f + bbci.l a2, 17, 1f test_fail 1: movi a2, 0x00020000 - bbci a2, 17, 1f + bbci.l a2, 17, 1f j 2f 1: test_fail @@ -192,12 +204,24 @@ test_end test bbs movi a2, 8 - movi a3, 0xffffff03 +#undef BIT +#if XCHAL_HAVE_BE +#define BIT 0xfffffffc +#else +#define BIT 0xffffff03 +#endif + movi a3, BIT bbs a2, a3, 1f test_fail 1: movi a2, 0xfffffffd - movi a3, 0xffffff01 +#undef BIT +#if XCHAL_HAVE_BE +#define BIT 0xfffffffe +#else +#define BIT 0xffffff01 +#endif + movi a3, BIT bbs a2, a3, 1f j 2f 1: @@ -207,11 +231,11 @@ test_end test bbsi movi a2, 0x00020000 - bbsi a2, 17, 1f + bbsi.l a2, 17, 1f test_fail 1: movi a2, 0xfffdffff - bbsi a2, 17, 1f + bbsi.l a2, 17, 1f j 2f 1: test_fail