From patchwork Mon Oct 23 18:13:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737288 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1665173wrl; Mon, 23 Oct 2023 11:16:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIfS4MAbuPD8/rommVmeJ5TRo9SBWqnwQVrrGESNcHP+qMSXMXreqHQ4Tts37eQgP84kFs X-Received: by 2002:a05:622a:7:b0:41b:4c0:cbf4 with SMTP id x7-20020a05622a000700b0041b04c0cbf4mr14419760qtw.7.1698085017579; Mon, 23 Oct 2023 11:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698085017; cv=none; d=google.com; s=arc-20160816; b=GbVqucrIT3Gd2KvzGXS8gptTg5p6XGjQcWb4XBstMkq7Z6JN0Pl56G0AnpbIiEjWLj A/3LMB6Z1yW5shOaiLEXKBPzTOTwDRuRG44BAcK+wsVqnhMDmrxL7FOj2ILjjqQzilEH yBTJMKVyCtJUg/WiLMIwiS4yhqW8jP6KPdh/GCJxamxkPbv0TeIyzZsbx6KmYQ8XIGrQ qv0oUeA0D92AZEOKLaXWuth/QcgMA0TYeI9ZKhD7zN+a8xWMXzKadmcZu35tUqkxaGp7 IZSZ0XGYZTtSNx+gKsIJw8KSLb0sfQAx+6B/bqXg5p6LGJkadV/7D+9OjfgE271khVhW yLCA== 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=HoubwkFzMAESazVThDNIBAh5pqmgk/UJhOFdR/AHQTc=; fh=AviQk2djdIC6erHNV64fPAlsYrBm9AENj/pCljp3+TU=; b=UcTIaHSIxYRJ0pE+es0U8GJ+vSUCoMUDupMfq0cQSjYOuEo5pf0zdcMfnJPgJ2Mg3V Z4i21VSpKhXegCyUe8qEQjMg+8mvZ7rAvqzTh3MU3EPqTXA2uhBBy+HgH71m7ajt39tk UMJ/hUs9Q+2ovZdLIEgB8Kr4gB9dxkoIwsSUxSiKYQSTh9RFmWTtoc+qU6Jk0ZhTKTBp yYHMUYB5RoZ5MEXQzPOHPQSK0PMVLXt0LVB29CbwNOUZLlEKnFbNp5cCc7S1yFH4XRqi KkNf04h0Y9ZUcMTXqrhe58Qym7mImo857Ela0sMPxcppOj+826axUvGL9paBBYAqoWcA mhWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UK+hUxzi; 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 v22-20020a05622a145600b00419630a935esi5589651qtx.237.2023.10.23.11.16.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2023 11:16:57 -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=UK+hUxzi; 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 1quzRe-0006Vv-Cu; Mon, 23 Oct 2023 14:14:30 -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 1quzRH-0005s5-04 for qemu-devel@nongnu.org; Mon, 23 Oct 2023 14:14:07 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quzRF-0008JJ-BU for qemu-devel@nongnu.org; Mon, 23 Oct 2023 14:14:06 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso2588441b3a.1 for ; Mon, 23 Oct 2023 11:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698084844; x=1698689644; 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=HoubwkFzMAESazVThDNIBAh5pqmgk/UJhOFdR/AHQTc=; b=UK+hUxziVmi6209mz85zviyKaFuE/Mm5UWiLebuAvO6ap+HuPZZemQqnvSNzqsNKQ+ Wxzf0jmbsgqoIhs/FjutuJYCwRy+xDUIw5gNXmMzK7DHnyN1INQWz+mQbOJ39dwdD3eH f7NH5W8m6pbFc9sHqNFxpsf9GKiRVUlGxHdwkoM/JSuerjtzThUv3CAkPtFjRYRUrDyv GtYQR67kxV+TOylD7tpL04V9WedQXAUch9I5KDlJQdYpRBXmCW9ciV8KJRoVbWnEkgL3 FzfnGhADGzRTxKURgELuDTtpSE8zwQ6EUUVcbSGaypZxlXBV/j5wdyrnbALlw+Rls7Ee pqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698084844; x=1698689644; 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=HoubwkFzMAESazVThDNIBAh5pqmgk/UJhOFdR/AHQTc=; b=JYxAr2EVgXtJuRpjtyDwk4VWYhii7DE1AFNWU+drvTvggftcfF8nqz7u+m+c+gwr37 Yw5g9U4McjSu1wMegFw7FZFTOoukkc2R7bBnPBKrJDBuIUfpXyjo5ZZBeoFK+paCBvpp ySJDLlXMrCkFlrX4oNaFaDyP0QCOEXKB0Zxp+WRFI8+tD7oQ6Mqlor4gxrHSFAbEgnrr Vhubk1UmE0eYGQZPe76wLblFFR8iqaRoFC8JGlNDwYl5caPVzeF6GKpr4UOdXw9R1Wfx Z14wvyNeHzbn4/o/aViSR1bK814GlaNxff/lVKGqzLserBjcxbnmeJtbsaIIfcraM2JP E3Wg== X-Gm-Message-State: AOJu0YyR+DInanvLNsRzxMMVvarwjXYM1JKaoDh2O4dm04cxWh66xFV3 y59pws9TUoyywBZfZqx0SFQQdphFFQqmWbOJTbg= X-Received: by 2002:a62:f246:0:b0:691:27b:15b4 with SMTP id y6-20020a62f246000000b00691027b15b4mr16941402pfl.5.1698084844093; Mon, 23 Oct 2023 11:14:04 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v10-20020a65568a000000b005b83bc255fbsm5205137pgs.71.2023.10.23.11.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 11:14:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Bastian Koppelmann Subject: [PULL v3 37/38] target/tricore: Use tcg_gen_*extract_tl Date: Mon, 23 Oct 2023 11:13:28 -0700 Message-Id: <20231023181329.171490-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231023181329.171490-1-richard.henderson@linaro.org> References: <20231023181329.171490-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 EXTR instructions can use the extract opcodes. Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- 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: