From patchwork Thu Oct 19 18:29:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735593 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1666586wro; Thu, 19 Oct 2023 11:30:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhXsQoaoeWea+i8JIyfAiFWOKIKbl4C9h2N71cnnjVAZb+tBG0G/A6paaC0z6XSzYoZ7q/ X-Received: by 2002:adf:f30d:0:b0:319:8c99:989a with SMTP id i13-20020adff30d000000b003198c99989amr2570987wro.8.1697740212884; Thu, 19 Oct 2023 11:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740212; cv=none; d=google.com; s=arc-20160816; b=E7enwQdSYgyHawoOzPLzugWw0oZ35u50jGfjTO6XoNgWhzFWhHkbqL9G4+Qom65jGN NE9+Ej74NZ6FdSlgLg4mVZxyqU5bKKRUWjEW/fM/LBNCFojodZbpKJ27GwxocBk4I2jn lDdZBaUXJHzOfu55+vZmEiL3Xa7kGgJp7tlAmy4vUYtrqOdFxt0F9W8tGnLOgvWMpAMy R6jyR5vAN6WiMpewKKM55iYD+xt79QjMGZSV0QRGCEabxlCn2GxUOlnrynmNEOIDlQvF mpP0JAd8EYa3PfYrWkgilCAzgHtpa97QF8m+lhjgQnxjBgBpfDA5Z5d8puUgttWAxNgb kgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=11JIGxMs2e2oQJXzv4Rfvtne38mlVuC/a60ICmsrKH4=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=UOoZObW+x6vvDsD+XYpNZdaesu1Kac6Pq+0e5YaakWXTtdPeJIqJGbyJXtimuwgmTt HmB1mXWe+xkpuaQCf0o1oQbN4RIN5efz4wCInwTLlTBqjet2XOatlRJXbXcfMNpenoXb CYF2/LWt+acqWXPOVPl79HxiB+GxbktPgwTXXhdl6zNMWQ0feG5No4zzokh9DnDzlqP7 H3u7GYCd5PgpLTewB9XrqZAvad9SVbLNWWeGy/IDqTDAyYGH+Vb2AszH9MSH9POyap0Y uDiEjnHsHTEAxCJzoxiAbotXXWtH32g6P9U7zl1r0UHT/eahXM/25pnYemyuYrQMBrzV QuVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oVs12sli; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l10-20020a5d410a000000b0031f87cb10bbsi2906535wrp.43.2023.10.19.11.30.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:30:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oVs12sli; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmD-0001eS-GR; Thu, 19 Oct 2023 14:29:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm1-00018s-D4 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXlz-0006zk-Ev for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:33 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5ac88d2cfaaso5057290a12.2 for ; Thu, 19 Oct 2023 11:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740169; x=1698344969; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=11JIGxMs2e2oQJXzv4Rfvtne38mlVuC/a60ICmsrKH4=; b=oVs12sli8mIyXLZ79DH4GlDWK9EsjgFmzDjaGl0RAnB5TFJRnt5aaG51no1nmj4rS9 YQM27Mt4+JXWyPmq8k048PWZ3+y946CVNbDBsofcinvRg/7FXzLyOXbyDi4JQ/3hohFs 5KBxqVJGOGVkeNdKHTCosAxThDWH+QaIMBxQxhkIyjRNW5ahLzeKAoshXuARFswiu5yo V/tifJXXeX59z7ALaI0RGItZNqR+y1GQFe3eOO7EudIcphi/fL+L4k8vXuZIcEPotjkj I2IbkTPXUrp4uCtVY5X1CkfwxvLyfDGjHk/sHR8KtPJ0cK5i/QkufKrKD6gZh0rGOLPQ Szsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740169; x=1698344969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=11JIGxMs2e2oQJXzv4Rfvtne38mlVuC/a60ICmsrKH4=; b=e9BJLTREHDGVqaqYQAsOsDsMWLfJUds/MW1TbX+UcLNM/QntsLFmfMO5QQhkQj/0Qa CPLt41c+y0bmExFiX3znZ9PFLauSnMaQmBe8ymUEPNVo6Spo/VnpzNOV0rXTp+ypYgXC jEK6zl1AwGisstXyYuboMDIfR3mMLTQrcIOuoQSeCkuGsFDZOWDix5HSk80y2fCbIwGw 9Wpswwj2n28cfw49FdAhatxIAbVCwNlYfY4x+fuwiUyeXsU31/hyaZxQYv0t9KVcfbw+ A/+yKvWxj4a1aEu/UplR+1pDXM6ORAD75zantxcIu9h0vXms3zm+saNkxR2KX2fvv8+p CUcQ== X-Gm-Message-State: AOJu0YyrPCTO8vZh679YQhTlZSloD/oWXY3YSsnwxPAZYG3CDSRllNc6 jXYas6gkizexzGWg61S+ri4tU38l93JPIQssSZo= X-Received: by 2002:a05:6a21:1444:b0:16b:e46e:1246 with SMTP id oc4-20020a056a21144400b0016be46e1246mr2491869pzb.30.1697740169268; Thu, 19 Oct 2023 11:29:29 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 1/7] tcg: Export tcg_gen_ext_{i32,i64,tl} Date: Thu, 19 Oct 2023 11:29:15 -0700 Message-Id: <20231019182921.1772928-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The two concrete type functions already existed, merely needing a bit of hardening to invalid inputs. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/tcg/tcg-op-common.h | 2 ++ include/tcg/tcg-op.h | 2 ++ tcg/tcg-op-ldst.c | 14 ++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg-op-common.h b/include/tcg/tcg-op-common.h index a0bae5df01..677aea6dd1 100644 --- a/include/tcg/tcg-op-common.h +++ b/include/tcg/tcg-op-common.h @@ -361,6 +361,7 @@ void tcg_gen_ext8s_i32(TCGv_i32 ret, TCGv_i32 arg); void tcg_gen_ext16s_i32(TCGv_i32 ret, TCGv_i32 arg); void tcg_gen_ext8u_i32(TCGv_i32 ret, TCGv_i32 arg); void tcg_gen_ext16u_i32(TCGv_i32 ret, TCGv_i32 arg); +void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, MemOp opc); void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags); void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg); void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg); @@ -564,6 +565,7 @@ void tcg_gen_ext32s_i64(TCGv_i64 ret, TCGv_i64 arg); void tcg_gen_ext8u_i64(TCGv_i64 ret, TCGv_i64 arg); void tcg_gen_ext16u_i64(TCGv_i64 ret, TCGv_i64 arg); void tcg_gen_ext32u_i64(TCGv_i64 ret, TCGv_i64 arg); +void tcg_gen_ext_i64(TCGv_i64 ret, TCGv_i64 val, MemOp opc); void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags); void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags); void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg); diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index e81dd7dd9e..a02850583b 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -219,6 +219,7 @@ DEF_ATOMIC2(tcg_gen_atomic_umax_fetch, i64) #define tcg_gen_ext16s_tl tcg_gen_ext16s_i64 #define tcg_gen_ext32u_tl tcg_gen_ext32u_i64 #define tcg_gen_ext32s_tl tcg_gen_ext32s_i64 +#define tcg_gen_ext_tl tcg_gen_ext_i64 #define tcg_gen_bswap16_tl tcg_gen_bswap16_i64 #define tcg_gen_bswap32_tl tcg_gen_bswap32_i64 #define tcg_gen_bswap64_tl tcg_gen_bswap64_i64 @@ -338,6 +339,7 @@ DEF_ATOMIC2(tcg_gen_atomic_umax_fetch, i64) #define tcg_gen_ext16s_tl tcg_gen_ext16s_i32 #define tcg_gen_ext32u_tl tcg_gen_mov_i32 #define tcg_gen_ext32s_tl tcg_gen_mov_i32 +#define tcg_gen_ext_tl tcg_gen_ext_i32 #define tcg_gen_bswap16_tl tcg_gen_bswap16_i32 #define tcg_gen_bswap32_tl(D, S, F) tcg_gen_bswap32_i32(D, S) #define tcg_gen_bswap_tl tcg_gen_bswap32_i32 diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 2b96687699..e2c55df217 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -714,7 +714,7 @@ void tcg_gen_qemu_st_i128_chk(TCGv_i128 val, TCGTemp *addr, TCGArg idx, tcg_gen_qemu_st_i128_int(val, addr, idx, memop); } -static void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, MemOp opc) +void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, MemOp opc) { switch (opc & MO_SSIZE) { case MO_SB: @@ -729,13 +729,16 @@ static void tcg_gen_ext_i32(TCGv_i32 ret, TCGv_i32 val, MemOp opc) case MO_UW: tcg_gen_ext16u_i32(ret, val); break; - default: + case MO_UL: + case MO_SL: tcg_gen_mov_i32(ret, val); break; + default: + g_assert_not_reached(); } } -static void tcg_gen_ext_i64(TCGv_i64 ret, TCGv_i64 val, MemOp opc) +void tcg_gen_ext_i64(TCGv_i64 ret, TCGv_i64 val, MemOp opc) { switch (opc & MO_SSIZE) { case MO_SB: @@ -756,9 +759,12 @@ static void tcg_gen_ext_i64(TCGv_i64 ret, TCGv_i64 val, MemOp opc) case MO_UL: tcg_gen_ext32u_i64(ret, val); break; - default: + case MO_UQ: + case MO_SQ: tcg_gen_mov_i64(ret, val); break; + default: + g_assert_not_reached(); } } From patchwork Thu Oct 19 18:29:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735599 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667908wro; Thu, 19 Oct 2023 11:33:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDdEvU+yj5/huLiJjRe5Bt6FJFn1CKm3NvBkhYdBZT1cRiMH9uxU6GYwzp5wqOCj5s4S/I X-Received: by 2002:a05:622a:11cd:b0:417:b06f:6103 with SMTP id n13-20020a05622a11cd00b00417b06f6103mr3852898qtk.21.1697740399969; Thu, 19 Oct 2023 11:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740399; cv=none; d=google.com; s=arc-20160816; b=jqP6rTsyeWxHjpSALCdB0IvRoDNy276B/GSOM71DEJGz6eP1CD52+mSX/pyXu96jIp PDLmCuLJUkF2vVX7LqJr1jn7gtBRL31Xngx/fMP8vQPct4/3OfcKmwC5JiQTF6YS75Wn SE4yoL2I4jmMnutifR0bMUEhJgpa/VEwk+WcRqLkez8E19bCZKfRKMf9SrA9B8qJXGV4 woTSN4+EuQFVHX3otxxE1BUKu7a7MBToDmjXb1MEKCUnmAXQlv/7yobLFRkHacCHXRmB D39/GaERNzhHowfUGiBgTyk3a1vEpUuhuMdaZWH14F+SyIHJN6hHmj1lmnX+NMaPFYH2 rL6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T4DZaKL6rPO4eOmJB5sgPBMNx7MhU9e4zPB2kNBWFXU=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=x08SKq7FoWM25Tv6nBSiQLi1dLJMUPLxHEI/9QgAP1vqMMOnnuu5u9l7nUwG16YcH4 tRqTUfpMdXcsDWBgGUALKsroZxyPTnRwk0ug9pOAQIWY1GTkCppVTPiopPsEUFzRTs7K +VVyASYAabm7u39SQUZBOA97JKZupG617EmOprxKcwxtulxXIPHoPNg0w4lTcQ44EfOP U+vi6CAMLW34H6VQULxpjL26AGBOSPqJCUw04dxoxNUG/C0DNKBbM4l87ZiX/+60YDN3 SF2paWgVDEVzFdoqhXms0wKY+wf0ixhxWMgyRrgEVHb1IR7kQaOATafeBeow2vjzEBX3 fvgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ba4cu1Zb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 17-20020ac85751000000b0041cbb5e5a86si19626qtx.428.2023.10.19.11.33.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ba4cu1Zb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmC-0001U5-Kg; Thu, 19 Oct 2023 14:29:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm2-00018z-8b for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXlz-0006zq-VI for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:33 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5b837dc2855so29887a12.0 for ; Thu, 19 Oct 2023 11:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740170; x=1698344970; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T4DZaKL6rPO4eOmJB5sgPBMNx7MhU9e4zPB2kNBWFXU=; b=Ba4cu1ZbCKqzQFiqJa5lLoVDXMEbhBpgJaa4vlC1Wn8N84L2I5yh1c/sK4VSodW86y N7Rctrz9ia6A5xxH1VoxokDF3/7jsBBPfdvc3xpUHLXXMzQyL5GkOXBYvIDBO1jsL8Pf Akay/L58pJ8wvqG8y70PH2YkKrkmquOWIMvl5QRQjGabdm/QzZx+kNKy1GP8tQCyfw8d ZT6ZdPwH0aFhDcUXhBB6+77OnZWfcMz+1EPv7ayvFM7NUC0Q6Jh1dtVa3YHs02HVok8k 0qbrtc1tqDTo0gitcxmS+iYa0+4pN1zWcFJNKoSYd0eNGouVmOx1cmvfJEXHODUkCP4U 511A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740170; x=1698344970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T4DZaKL6rPO4eOmJB5sgPBMNx7MhU9e4zPB2kNBWFXU=; b=JOVJhkM4C92gvkVDp7LaUbXpoyKULNt1hxKM0ceLmsgeu7pn1kEUK13gxFbiLJIY6K V+zHyw6zD5mdg2TU1j28dcH0XwvyVT6RR/Bt0inxQ1ZMmiLq0gLBUFHLkkD/GEtdxieH TGbRYihINcWqVB9LF+AjS9HyJfqsr4/+No3lXCHw47rb1WWDIoD2RYpAVBAFY1p+zgtN 2EkzLbpTjr7iN99s2jEcSqHCkprW+97qlvPcfIpYhnS0txe6HnOE66sCq5kB7nEUG2To tszbllNAIuymBNO3N2/+57zouWV+YwH8Q376vbVYJzyufisAmJ2r74l1MWie4fD7QOHM SFBg== X-Gm-Message-State: AOJu0YyW9u1N36bFza0T6cXMexHfRu4JYDVorKMdVXqswfEB5OZXJHaG 9PrrQBPP/KNIOziZCLgK3VyfOP0OxreWmjM7Exw= X-Received: by 2002:a05:6a21:a5a8:b0:133:1d62:dcbd with SMTP id gd40-20020a056a21a5a800b001331d62dcbdmr3977924pzc.28.1697740170085; Thu, 19 Oct 2023 11:29:30 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 2/7] target/arm: Use tcg_gen_ext_i64 Date: Thu, 19 Oct 2023 11:29:16 -0700 Message-Id: <20231019182921.1772928-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The ext_and_shift_reg helper does this plus a shift. The non-zero check for shift count is duplicate to the one done within tcg_gen_shli_i64. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/tcg/translate-a64.c | 37 ++-------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 10e8dcf743..ad78b8b120 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1324,41 +1324,8 @@ static void ext_and_shift_reg(TCGv_i64 tcg_out, TCGv_i64 tcg_in, int extsize = extract32(option, 0, 2); bool is_signed = extract32(option, 2, 1); - if (is_signed) { - switch (extsize) { - case 0: - tcg_gen_ext8s_i64(tcg_out, tcg_in); - break; - case 1: - tcg_gen_ext16s_i64(tcg_out, tcg_in); - break; - case 2: - tcg_gen_ext32s_i64(tcg_out, tcg_in); - break; - case 3: - tcg_gen_mov_i64(tcg_out, tcg_in); - break; - } - } else { - switch (extsize) { - case 0: - tcg_gen_ext8u_i64(tcg_out, tcg_in); - break; - case 1: - tcg_gen_ext16u_i64(tcg_out, tcg_in); - break; - case 2: - tcg_gen_ext32u_i64(tcg_out, tcg_in); - break; - case 3: - tcg_gen_mov_i64(tcg_out, tcg_in); - break; - } - } - - if (shift) { - tcg_gen_shli_i64(tcg_out, tcg_out, shift); - } + tcg_gen_ext_i64(tcg_out, tcg_in, extsize | (is_signed ? MO_SIGN : 0)); + tcg_gen_shli_i64(tcg_out, tcg_out, shift); } static inline void gen_check_sp_alignment(DisasContext *s) From patchwork Thu Oct 19 18:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735594 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667155wro; Thu, 19 Oct 2023 11:31:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRv+s83v/Ue4QPJY91YWgdFTjDInCtwZud3bcS9OaSQuLCpuCEluOnyhhFdMN4NMthl6GE X-Received: by 2002:a5d:4b05:0:b0:32d:8855:138d with SMTP id v5-20020a5d4b05000000b0032d8855138dmr2508459wrq.66.1697740285963; Thu, 19 Oct 2023 11:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740285; cv=none; d=google.com; s=arc-20160816; b=JbWG0GNv48ihqQzyy8gJ/6ms47VnS397vnMmIkFYnt2FlYceKW6mKDGmYyvxwxjK4x awe8eCjI4a/yfEmgQB/Lhfzn7Dn4vxT0RN6oy/Tly2E3OfaO0eHKezM9aArC2g4hGtmr 0jey/lYFMQvKRMeWQ9vZ2BPzwaQRZ6ruXKOyzPJIGoP2H1kYMlfvPgWFNiTDxG2rKf4y W2QB/b7Wix2QJ04AEYCYXLgQ0rYD/5wasp4xSIrwsd2nq1lLxZH+ud1QUhUhzPfXXz78 o8/I2eyFs8AM/oMMyqJOe7p9oMLVOOJv3x8yJNjlqsuBmBN7F0BNgRN+chllahNdPZ9O bwcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=vFxoogoOs+N27dXC5uPCLEQ3K9VltaB6hZFuge+0J/Bm8DmPJYy+3PFSLvvZfxIzYy D1jHjkjLfNkgI/Z8SehNgMAZ/IqW6Nbp5rKTYQmTE24g1nk6fuJjD7VugDhET5oVpXej RQpr2LdWF6lUY3E490JzZCIRyUTuAvazPXk3yKcCZOsxZG7qGN+FwOEYDdtm7tS0pLbK 0JVGf5oWgNN88HSvva0OAGW+EHf0vd9AiIAvhp0cY084pHAeFaK19ec6SYBrak9UDMOB EBKvonQbV14laAHqIMcNnNwF1EFz/fDWEJmsyf1M0RgqLChdqe8lS+Ig+9BLlmzhuj9C SOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zh0kQBnk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f13-20020adfe90d000000b0032da83b58efsi3005208wrm.272.2023.10.19.11.31.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:31:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zh0kQBnk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmE-0001gI-9g; Thu, 19 Oct 2023 14:29:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm2-0001CF-Lz for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm0-000702-Ky for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6bd73395bceso43195b3a.0 for ; Thu, 19 Oct 2023 11:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740171; x=1698344971; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; b=zh0kQBnkOyd5FEa6nqlPKJapwabOdbaN7nICILgOu35v+V0ZQk+R5zYI1i6T7tJYKO PJvzWxNKoKhZlA2DHugI3fbfppOEt+vgEFyDgqhAB1n3LnqQNfccSmXSl1j/hzEzclb2 OzehKDxLroEhFLfUsvj8JsnobGbIQdjXQxJYlxldDd7QfrxS45Q+02RKwm65JzteAaaj Xtogt7YiUE1cegFR846WpSS0cKr91iz7omLESsbAEd5KpGx5M1PUw+2DL1LipFEfQ4TB L0RZxCF9JWhQemtfoyE5fUvh0fRhHdvff5qYQEPVLPsvWkU0oaQ6jyDikrI245cnT1uA WljQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740171; x=1698344971; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; b=rKSqwmCM8NdfE2onWkkbRCensXepn8POspXG1plqtCoNZh/9k0aBDAS07wN/7SjvR1 bMMc/jGk96rSGl5qoMHy1euxwjhwqJ9wAEJyYdsXqkQi8APXdH1qw+L8Re+IcrLrxCOf sfPfG5L6MWoVxRiPrfljJ471PkRJ+E53brOdc0glPU5WHn/PCgmG2JLP8ebAWbA06DH8 8KykXZdE1p+OzUth6Klmr2t9yjOfkMlbCD6HCzYjyW8vKdHpN/pXUXJWrNAzyrQyeFV4 vSdFcloj8PFM/8ucHuTYZm/fhE9iLSaAEb7SqfwLszSRPboiMe3ybtik4WLFMrLMO19s 31WQ== X-Gm-Message-State: AOJu0YxJ6FWDv45A2HJ9jtPzMpTmSN886RA4RzOsRVJCkqOZS1+jGnrG qdR/UPwmCnQv+IQ4uhKSBmQQdTU8L6YuIgy3VKM= X-Received: by 2002:a05:6a20:3951:b0:15d:8366:65be with SMTP id r17-20020a056a20395100b0015d836665bemr4069051pzg.9.1697740170928; Thu, 19 Oct 2023 11:29:30 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 3/7] target/i386: Use tcg_gen_ext_tl Date: Thu, 19 Oct 2023 11:29:17 -0700 Message-Id: <20231019182921.1772928-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 0c81e066de..d420ed8f0a 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -701,33 +701,11 @@ static inline void gen_op_movl_T0_Dshift(DisasContext *s, MemOp ot) static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign) { - switch (size) { - case MO_8: - if (sign) { - tcg_gen_ext8s_tl(dst, src); - } else { - tcg_gen_ext8u_tl(dst, src); - } - return dst; - case MO_16: - if (sign) { - tcg_gen_ext16s_tl(dst, src); - } else { - tcg_gen_ext16u_tl(dst, src); - } - return dst; -#ifdef TARGET_X86_64 - case MO_32: - if (sign) { - tcg_gen_ext32s_tl(dst, src); - } else { - tcg_gen_ext32u_tl(dst, src); - } - return dst; -#endif - default: + if (memop_size(size) == TARGET_LONG_BITS) { return src; } + tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0)); + return dst; } static void gen_extu(MemOp ot, TCGv reg) From patchwork Thu Oct 19 18:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735597 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667763wro; Thu, 19 Oct 2023 11:33:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw/J3JSV2nm+M1us3StRteiKL3uwH4CvRgkwwdVjgYoTNX95hgNvmNUTaLhI3Snj09cvFT X-Received: by 2002:adf:ec0f:0:b0:32d:ae31:4595 with SMTP id x15-20020adfec0f000000b0032dae314595mr2170571wrn.65.1697740380116; Thu, 19 Oct 2023 11:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740380; cv=none; d=google.com; s=arc-20160816; b=AH3bdRM5Q+quePE5zt8J/PKHUcI5zU67v/+ZVEXIL//MgxKPjHwdn7qjXVxOP+hbB4 Sn30z9UI3Jvk525GIWP2Ag78O5z7/urjJ2XilzcSg5/TwUWxjxa7zmgOTmA2P56ljy5q QG7sjoXo5PZzCm5I36YE2OjD93Vl+EiDcWFvwifj8QwOHMv5v6slo0H+edmOZnE3UQHc y8FF0JQdWX5cQSKmNuf+jONOfhclOwVbjOZMoDJvzqfZ8j6ib78tL/7gxgZaVFhjq5U5 Zx1L+46f9SL3SC+6ToLmK7SBOrnnitD8Vs7vt1t04rQwAmJTmAl1A75LcdGSL9q8eLnQ 93Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=s6AOIAPU5fci+W4LveTKSuSXnuw15ZArWwTRPw4nl82a1DCEbR2ewPpbJMa8KOpHbd vDYUil8Vv1ielaJArseeqiuzDP/4F0nPya6CMYNTswrWsZYJnNpGsEJi7+XfLmBZ74hs fmZiQXqml8m8OHrqzLJuDz4tyY+ZwD40RXM6z9njfU7CCJ2PZgDm4Gq+EPcepq6aQCSL vdZ64RLYCmZi5aSivJxRiT5nO/HAXSuFGKmiRNv2xMzvN/nMeR3R2N1K0MC3x2+FeHgX qSl0B8m5EeQOwHPZ0akhREU6XzveebMY/aHQtXNMaV9wfMQ+mwt5yIKXdE07n9DZ3hkD qUZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JtyS7KTy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b18-20020a5d6352000000b0032db012cdf0si2979745wrw.621.2023.10.19.11.33.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JtyS7KTy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmG-0001wS-9D; Thu, 19 Oct 2023 14:29:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm3-0001EZ-O5 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:36 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm2-00070J-0F for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:35 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-692c02adeefso27526b3a.3 for ; Thu, 19 Oct 2023 11:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740172; x=1698344972; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; b=JtyS7KTy1ie5zGUkNihJrRy7pnfBos5uFWe9HAFkObkiPzUNGw2gC+m0x5Ppq5vBwC Xj86FldBqC9pt5ExlfNZ7BRTLTBir+vVOSbmvu+bj4NT8L1x09YFikRVMTVBrrq1VKVY TOVkhWzy92betSs4FTo+VEatGar7TIG+zzkWmErR2tPAlQ8GCCL69tjH86cy0F8sHOHF DChlTAO/HJdQWEYgsbP/q0LxaBOkiqO7Ja9bVvaxoidThHYjEPrdaNjXyBfiHJwRpxAh d3QFHKtJ8TvvUv/Xw+NeSM66U2aFHXfypGc5zZ8aqPJT7KSmJ4Wha0LolEU5ti6eMiSx yntA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740172; x=1698344972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; b=vyN4amfz2khQh+YX6P6fDI5HFCPr62j+3RjtYydUxoVMycpLLXOVGMa5dUIJrLfG4w +F2vZ4xrVxZzFvFSYY22mEattWDzrv6oT2VNwCBAbJc6DSeg+m7IeAJgRw0sTJCmUL0m KZtWf8nrRvZiS8Fh0U2Rt7HkFVy5nCS7EOvk8L2VjS9ZqtI8hXehS4fW1GGNaMBDad66 LY29Vs2ttfbr7vjj/xtuz7gde5fTS73wU8xS7v799awlEPGyiR1xucKkzi8SMeoC2eG9 SChJbKcZV+YIeKDLqoodxvAEmdmVxQ9xVL04isTMvxmcBoMNRDK8kN4TrciHdHta1UZU TLGw== X-Gm-Message-State: AOJu0Ywg+OOXTyaSYbx9CC79QyMGnI5PyhJJgJQutfaeXIIl+k8sV1q5 0k409o5N+zJ/dF4jD39+VBzFCjHz4X7zypXDTlQ= X-Received: by 2002:a05:6a00:b91:b0:6be:2e07:5c5c with SMTP id g17-20020a056a000b9100b006be2e075c5cmr3153002pfj.20.1697740171802; Thu, 19 Oct 2023 11:29:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 4/7] target/m68k: Use tcg_gen_ext_i32 Date: Thu, 19 Oct 2023 11:29:18 -0700 Message-Id: <20231019182921.1772928-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We still need to check OS_{BYTE,WORD,LONG}, because m68k includes floating point in OS_*. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4d0110de95..4a0b0b2703 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -520,21 +520,9 @@ static inline void gen_ext(TCGv res, TCGv val, int opsize, int sign) { switch (opsize) { case OS_BYTE: - if (sign) { - tcg_gen_ext8s_i32(res, val); - } else { - tcg_gen_ext8u_i32(res, val); - } - break; case OS_WORD: - if (sign) { - tcg_gen_ext16s_i32(res, val); - } else { - tcg_gen_ext16u_i32(res, val); - } - break; case OS_LONG: - tcg_gen_mov_i32(res, val); + tcg_gen_ext_i32(res, val, opsize | (sign ? MO_SIGN : 0)); break; default: g_assert_not_reached(); @@ -1072,15 +1060,10 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, tmp = tcg_temp_new(); switch (opsize) { case OS_BYTE: - tcg_gen_ext8s_i32(tmp, reg); - gen_helper_exts32(tcg_env, fp, tmp); - break; case OS_WORD: - tcg_gen_ext16s_i32(tmp, reg); - gen_helper_exts32(tcg_env, fp, tmp); - break; case OS_LONG: - gen_helper_exts32(tcg_env, fp, reg); + tcg_gen_ext_i32(tmp, reg, opsize | MO_SIGN); + gen_helper_exts32(tcg_env, fp, tmp); break; case OS_SINGLE: gen_helper_extf32(tcg_env, fp, reg); From patchwork Thu Oct 19 18:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735598 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667779wro; Thu, 19 Oct 2023 11:33:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXeTpAdtYs6s8CcvRfNKJgo26MJoh2o7DBMIcl+Qjmda2k+uQrseNNNZlMiIygdrhtzNbr X-Received: by 2002:a2e:90c8:0:b0:2ba:34d0:fa5f with SMTP id o8-20020a2e90c8000000b002ba34d0fa5fmr2105394ljg.37.1697740382862; Thu, 19 Oct 2023 11:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740382; cv=none; d=google.com; s=arc-20160816; b=TMsDZF+jOnnjDqk7Me2z4dK80CYZ+Wd+Kp7xGy8229G8N+qGfXGpgplD7M1bVfQtzT pgB2+PRfbrPBQYnMo3zFl4013U+m7Enlo+Hy5jE4BWQnu+zXMmc9zIjT39X875mRK1Sg qG8CkeJbLEU8IEZQs9Fu+3f4i63S47KgY94xvPkIymmEQkJD/t/4CuAuVdOm7/Q4t2L4 ReaEUtGqIYHdA1byJQxvr6sTKtJSFix6oqGIGjeiohtvzzvRVQIqOjIzaHQQfqUKbCiv ozwiecNtBQ5FnD1XqQGo5Ckvhh14q9hdN7R1Jn5eDC7oXZ2eayCGEpcoTAEdoDXo0jpj F6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GGIXoZILq0txY1tXatn/JVNUB8nGVXg1ja2k0qG9p7E=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=FJVsCLTMj7rz5UuLf/ubjQl7iaDuZKB2Jtvoll/Kv+qRXLIlc8L4+FLeTrLK/aDLMv 3CiGYGZm2J1MpoW24wPscIgkaHpgOTg04xzECrTq5g1j1OdteI+jkDu7Ogq4em0wRTzX hfvpvUJBOM4KL5Wayg5efSYu6jBYAToOhZ0GXQ1JVSr2JhhiV0JtweOY5CYxdNGPKxfV TDKJz76mEZXJ9+in/HOukGJw5qjAtPU4N4e7qwAJn0688FPIX7corLhO0iSG21z3mnbx udWToHHfOEaadJ23PWI/fIhbTqkfjxYAdLOMuMAonLrLDone66hfr/i81ylrbYmpZVq1 x1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IQRj3APv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j18-20020adfff92000000b0032d892de387si2928195wrr.359.2023.10.19.11.33.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IQRj3APv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmG-00022F-SG; Thu, 19 Oct 2023 14:29:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm3-0001EY-NT for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:36 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm2-00070i-2T for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:35 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6b497c8575aso36144b3a.1 for ; Thu, 19 Oct 2023 11:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740173; x=1698344973; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GGIXoZILq0txY1tXatn/JVNUB8nGVXg1ja2k0qG9p7E=; b=IQRj3APvcYwc11Onno7NTHpQNNttUTekKgIPcvUxek/Ni1O4uFzvV2V5Qor84Ki+Fh Uya8nfGu9ARsWDJlTmdfk8HxvG9Q7mpC5APe+yRCCA7ao3OlfwjVGdiMuM9xFvF2lHfn j62hApSjsuk6mNNKIRzgyoDOIawrp5qlD13zPha2toMNJTtj0GCQGpEo0fOtSNn+ZeMl 3wVhhDG0RusMav8Ntfn5WbDDzpy6a7CXZUOCq3JZEnqBheOoRkJh+scWNd7tlVPdCQNZ KyjgOZjSkT3spliXyC+9OpPjXm7MkT5RXlO7S5YDqaPXSeFSjyNmn8qFvu5rhmrHZW/8 hx7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740173; x=1698344973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGIXoZILq0txY1tXatn/JVNUB8nGVXg1ja2k0qG9p7E=; b=jyNg5jvtyYC7EGOKE+pkiHWzBo0HkuKlwRPJzEn6IgtWs+Q3i98/L585I+ZRcufA27 vdNlMdw8I+D6KBZN2vPa13H7FOd83SM3k6rSUil5Wbxq2H9pdopg3ae0jWoH/55wTBTT LapGhOo+cHYrx1ywiXxUNTFI0x84wLUqnr3b+QwqqDpAE/ulqt4ZtR+bNlBE2UlcTO75 /9lDdaJA+oXAtFdmbFg308nxkWEt/b8xlPdnlmgUMDsurtvBaoDLYuahHyAtAF7H9Ja3 kjuG0r0i5SWhsb/4UVrXJncZGUu71GXPDs7OYEIWGNZbz7/bWbBVxoagLw4TzM6uwz47 082Q== X-Gm-Message-State: AOJu0YxIzkv3hgnB8Jw9CarANl1ESXjmqkCHkYI1EaC+2EyqKAKEC/eP Ro/BNLHVZ9I/n3N1N1kyylykg7dqA1SNuGJ40MI= X-Received: by 2002:a05:6a21:71c7:b0:17a:f1eb:e143 with SMTP id ay7-20020a056a2171c700b0017af1ebe143mr2920421pzc.26.1697740172755; Thu, 19 Oct 2023 11:29:32 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 5/7] target/rx: Use tcg_gen_ext_i32 Date: Thu, 19 Oct 2023 11:29:19 -0700 Message-Id: <20231019182921.1772928-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- target/rx/translate.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index f8860830ae..c6ce717a95 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -492,13 +492,11 @@ static bool trans_MOV_ra(DisasContext *ctx, arg_MOV_ra *a) /* mov. rs,rd */ static bool trans_MOV_mm(DisasContext *ctx, arg_MOV_mm *a) { - static void (* const mov[])(TCGv ret, TCGv arg) = { - tcg_gen_ext8s_i32, tcg_gen_ext16s_i32, tcg_gen_mov_i32, - }; TCGv tmp, mem, addr; + if (a->lds == 3 && a->ldd == 3) { /* mov. rs,rd */ - mov[a->sz](cpu_regs[a->rd], cpu_regs[a->rs]); + tcg_gen_ext_i32(cpu_regs[a->rd], cpu_regs[a->rs], a->sz | MO_SIGN); return true; } @@ -570,10 +568,7 @@ static bool trans_MOVU_mr(DisasContext *ctx, arg_MOVU_mr *a) /* movu. rs,rd */ static bool trans_MOVU_rr(DisasContext *ctx, arg_MOVU_rr *a) { - static void (* const ext[])(TCGv ret, TCGv arg) = { - tcg_gen_ext8u_i32, tcg_gen_ext16u_i32, - }; - ext[a->sz](cpu_regs[a->rd], cpu_regs[a->rs]); + tcg_gen_ext_i32(cpu_regs[a->rd], cpu_regs[a->rs], a->sz); return true; } From patchwork Thu Oct 19 18:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735596 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667661wro; Thu, 19 Oct 2023 11:32:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsEnvUrGDwc01wiVuttFdNlhzSe8VrO2czJeTam9QmyqEa2AW3Lqh//G6+5GWxhdhZa4Ho X-Received: by 2002:adf:efcc:0:b0:32d:a2a3:9533 with SMTP id i12-20020adfefcc000000b0032da2a39533mr2074573wrp.59.1697740364853; Thu, 19 Oct 2023 11:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740364; cv=none; d=google.com; s=arc-20160816; b=oYmWcP/RKcvWQOnfaeGBeZbwVOTM1TIbije9fsMaD7t2lALHARvjFztTTDB/RH1P5E S0eVqPlGCVfmBxZ6JujZGEW65ndaENEcPZQDMZLYR2d3HHaGvtm+eUXgCcgVL4vWOCIW 3Pkm4vzLNvp2bFQDazqod1wYxek3Lm0EV6cTWDPsnRGQRaOEGNFl1pBS9zQ6a7kREkK6 GdcVmKIesYKlReq63awVelCQvz7cBgiJHiUvuLu1zDL6zwSW4jnh2pI1f9FgoiTbrxGZ 8xZSen5z43kxmqZZdiG5ZG3VkoUOpk/s7XIaI2wRz+mHH8dNVCcTbZehDHUTsKQtHUOz m+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QTHub7s42k1B/V2tyKlIn0Lpz8a5cI37rRdHq6Exv2M=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=IXwK/LQWhMYSwRS80DRyl/tcu5x/b9rE8vD8CQlEm+kPLcaO+7H9fwm/ZDu7xbkqHd tM6ZvUGSSwqMrAKzW1nR4J+yYuISjhT4rKtGv+Vgq+gs87sw2CSlW4ndHmNg4Woa3w0G Sq8EuPlrkMuf4whRG3Xzqjiz4EAqBiqRX27kUXBmX1w8+gPea0x18ZIxexEoAUU7zYYb 76Fk17nWkVBExey+ZOD+1yyb+gH8vZboM2tnenCo+ndhlJU6QlL874Vc8eY0XjQB5XUy cigejmyn0Pl0n/FxSBx/WEbKRl9lIcWUMhva8Mao8iqAOGFMz7s13GztcNen1gmfvu78 zI8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=whmmY5LM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d13-20020adfe88d000000b0032da50d8e29si3157677wrm.609.2023.10.19.11.32.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=whmmY5LM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmG-0001wp-C0; Thu, 19 Oct 2023 14:29:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm5-0001GQ-0Y for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:38 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm2-00071D-Qq for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:36 -0400 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6c7b3adbeb6so18347a34.0 for ; Thu, 19 Oct 2023 11:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740173; x=1698344973; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QTHub7s42k1B/V2tyKlIn0Lpz8a5cI37rRdHq6Exv2M=; b=whmmY5LMn3znDQrLLT4JrGHCHWWXKY/5JTNFQoljg8rPaIavLxE5i0YIM5Nh7f9Lq3 KtSv0V6MNbwsFiqULRLI8JoDsYFQesnFvaKaZd213xvUlgK967rUMTIXLT15m2XmZPvy CzyIQXgYc3fVW9OSD/O83eBQc64FmL9MM+cQK3Qz7oUfUTChyc3IoCx16B63kKN/oBUC z52IMwhaFe9UEQVBn9/UM6scSCa7ixeamElNPlut+TPLCUp/MN7y9HE7BK2iUBQIvx7C g/29LntXw4hSSJUxteucjOCTS6gNNyYpPn918Ravn+BdkG9DnUH54FOqGA7CJeHZy7Fg +2Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740173; x=1698344973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QTHub7s42k1B/V2tyKlIn0Lpz8a5cI37rRdHq6Exv2M=; b=cP21zVhsAqng2E/NxfBc68N81wUdTsNQGHdUvOUWGVe3eyDA53+Y9A/gvfnVEP/eFR 7PdbPZh4NlGUMgWDltzx7Ag1VZ5zn3P53fJlgFMUpGq63PPT2fiuASJkAKWFhTqwD913 A/LRA58ASiAQ7/enkV2vuzxpkKkMxTLZFP4eiZJ1S0RaV7bhjkaJRVs+qONZ1p324HY5 D++iNqHqCEO2i6T/anU/HTztoiftvTBQfWF/6TWZtinBvxSLCFXqSS+geQ6QmZCtE88C Kor7JOyXOdBL/3sOQZDQ7OxWq8h4xcF3RQAwsNkXjiRwv0U5n4/TkzlMcgVvIQVu55sa r5hw== X-Gm-Message-State: AOJu0YzhqS71u8Ob+chKjifb6amlWhLIW67lNVJrURBuw3w/D5td7jvl eKM2yHsiqqbD0MfqvjdkVhgiG7+0TSqZI20xa2w= X-Received: by 2002:a05:6870:82a2:b0:1ba:8307:9a13 with SMTP id q34-20020a05687082a200b001ba83079a13mr3479888oae.11.1697740173583; Thu, 19 Oct 2023 11:29:33 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 6/7] target/tricore: Use tcg_gen_*extract_tl Date: Thu, 19 Oct 2023 11:29:20 -0700 Message-Id: <20231019182921.1772928-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The EXTR instructions can use the extract opcodes. Signed-off-by: Richard Henderson Reviewed-by: Bastian Koppelmann Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index dd812ec0f0..66553d1be0 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6542,28 +6542,16 @@ static void decode_rrpw_extract_insert(DisasContext *ctx) switch (op2) { case OPC2_32_RRPW_EXTR: if (width == 0) { - tcg_gen_movi_tl(cpu_gpr_d[r3], 0); - break; - } - - if (pos + width <= 32) { - /* optimize special cases */ - if ((pos == 0) && (width == 8)) { - tcg_gen_ext8s_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]); - } else if ((pos == 0) && (width == 16)) { - tcg_gen_ext16s_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]); - } else { - tcg_gen_shli_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], 32 - pos - width); - tcg_gen_sari_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], 32 - width); - } + tcg_gen_movi_tl(cpu_gpr_d[r3], 0); + } else if (pos + width <= 32) { + tcg_gen_sextract_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos, width); } break; case OPC2_32_RRPW_EXTR_U: if (width == 0) { tcg_gen_movi_tl(cpu_gpr_d[r3], 0); } else { - tcg_gen_shri_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos); - tcg_gen_andi_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], ~0u >> (32-width)); + tcg_gen_extract_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos, width); } break; case OPC2_32_RRPW_IMASK: From patchwork Thu Oct 19 18:29:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735600 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1669402wro; Thu, 19 Oct 2023 11:37:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9mn8QSOIHf+LSwcCB4djM7h64tC2jz+6tiYjAHasqziV4QLxGmaDVfydsSVlKUZIzRdB9 X-Received: by 2002:a0d:edc6:0:b0:59b:cfe1:bcf1 with SMTP id w189-20020a0dedc6000000b0059bcfe1bcf1mr3150442ywe.44.1697740636341; Thu, 19 Oct 2023 11:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740636; cv=none; d=google.com; s=arc-20160816; b=rBBLk3Llze72KLTKBEfDORwMGj+vrYpvNiXqoAKLqu7ZW/OJLOd4p+8JwH1x2FlRyT lSNWF8/Dn46tmCq+Y9HJRh1RFjrWfHS+//tTr02WuUeiMF5KKFnkWDUwuFIO0t4LgC3O QSqgQqBW3lxmf9zjZnNgknA5J8SHI79u27/7IR7/qMLaDc4PKe5cYkDyosuZi/yrLgEm /dCJQgyA/eueeu9nlzTJQs1RYs9+mheQqiNxd0u34LlmMOlvv+PisL+nJNwHMusgiwA2 W6hksTE8il467zdxgJfecmU3m6aPVEIB6gOjKeu7O2BBwysk3RYeLEMhph0kXT859ib6 Savw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wAV0MQyuUvJwJtAe5PEULJLUpPvnw9Xv2CxQWX7wnBg=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=BEk+6qINlB9h8fT6EPR/YThOLLZJh5h8MO9EhKeNKdGQnBoFOnaM/Jx9G8zVx5ylSF YEAahWxF/ldNq5aPyef9C+LpA3G8QLwK7gzpmAmYf1Ygm6rq/g7CElsSbjJ+yBeDL3Wk Dm8sbZS5bMoJAeNKJKFLYY/2PabEIW+mlxiRE6EOi+QdcGxgO6vdjAhuZZIp0zxbjrr7 ITp61hQ332S+OkPvVmmAAGbxpgs6AORbgKohzPdLF5RasQJ3EL7LkygGSRREBsLHkQ0d c89ZiNUS24vqD030R0ce7CAw/LXVVIHJs+S5TACdgYclm93Pi/uHKDJWdCNkcFkeJ1an ykGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mT2edJl4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u11-20020a05620a454b00b00767247d8e3esi14582qkp.654.2023.10.19.11.37.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mT2edJl4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXmF-0001mS-A2; Thu, 19 Oct 2023 14:29:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXm6-0001HY-0W for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:38 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm3-00071b-LF for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:37 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-57b5f0d658dso6870eaf.0 for ; Thu, 19 Oct 2023 11:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740174; x=1698344974; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wAV0MQyuUvJwJtAe5PEULJLUpPvnw9Xv2CxQWX7wnBg=; b=mT2edJl4xwQl7S+FH+YhboxieIPTU/i/2D/Fi1gLIctRubxCAUiAQt2pbg6zdjaV4o Cfr4VMZ2A9KHpjDCjaPy9KImyM7rbsCBCjI/yq+vGnRd2W80i+OIM2QJAD2QSHuySNoJ YMLJtjXZMc8eCKAfErLsLYT0g0LzChm2rNRizLUDmRZaBtVjgHfGtYfW/WUogF1cAyz1 jE+DsuKNGVOLETfq84sTxH6RMMZkNEeximTV7g3ldzHVXbW+zdJ+o4mOV7xTGFs4wyJM 4vKV5693eCeDuKDcmvonpy4CAIJoaC4CMtVcanyXz6HAuG2CIApJxtMPj0wHxkxorRAx vBLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740174; x=1698344974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wAV0MQyuUvJwJtAe5PEULJLUpPvnw9Xv2CxQWX7wnBg=; b=rEpfMjquwqhlgOaQ6x4A6IKgQrW3d/tLA4FhaDTRkQqW0uYUe/KNVfwsqAXrxEMlYo dbU+cngBY+4jAKhaGmcGzaXfzSGFu910C4YsxLdklYwqJFVA5nzU6b5UBtLKDAQxJTMK XARhI7gGT0CiX+25yyVC9AVhQK4v/Cl5pCjB78N3IfsVAJYv0CKmZeZzhTBUj+kzkVwQ rlPNpEjzrukFXa1eh5trP7nvMBuxmVrYSnC1m+27yJHfe9Uy0zTxeTuP9cFMdy7aUsyZ NqCKo4kDKcJrHMdOhC16TJcOb3CVra3/Tv/n7s19rOzjpFSad2fq9Q1hdX7LlAE5Oxqx TdPQ== X-Gm-Message-State: AOJu0YzmQ3MLQmZQajFZlt9bQVKnqT7Rt7KgIy8qPaRNxyjAbn3NCf5S pEu9mNI8yrRGyGUIVX8RPbNEXBjjU6fRVR7mQc4= X-Received: by 2002:a05:6359:5d26:b0:14d:b8d3:97e5 with SMTP id ps38-20020a0563595d2600b0014db8d397e5mr2656647rwb.20.1697740174416; Thu, 19 Oct 2023 11:29:34 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 7/7] target/xtensa: Use tcg_gen_sextract_i32 Date: Thu, 19 Oct 2023 11:29:21 -0700 Message-Id: <20231019182921.1772928-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 54bee7ddba..de89940599 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2262,17 +2262,7 @@ static void translate_salt(DisasContext *dc, const OpcodeArg arg[], static void translate_sext(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - int shift = 31 - arg[2].imm; - - if (shift == 24) { - tcg_gen_ext8s_i32(arg[0].out, arg[1].in); - } else if (shift == 16) { - tcg_gen_ext16s_i32(arg[0].out, arg[1].in); - } else { - TCGv_i32 tmp = tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, arg[1].in, shift); - tcg_gen_sari_i32(arg[0].out, tmp, shift); - } + tcg_gen_sextract_i32(arg[0].out, arg[1].in, 0, arg[2].imm + 1); } static uint32_t test_exceptions_simcall(DisasContext *dc,