Message ID | 20241110125550.787007-4-hjl.tools@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Ot+mJh8U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XmXlW6tgSz1xyk for <incoming@patchwork.ozlabs.org>; Sun, 10 Nov 2024 23:57:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CDA73857C58 for <incoming@patchwork.ozlabs.org>; Sun, 10 Nov 2024 12:57:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by sourceware.org (Postfix) with ESMTPS id C62033858C32 for <gcc-patches@gcc.gnu.org>; Sun, 10 Nov 2024 12:55:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C62033858C32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C62033858C32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731243368; cv=none; b=qiccWj0TNRKIyRrwtMAjspFGbTSRd7iZGX2wDLQ0V9M03jD52j1AI2XRwmehRTNK7aZLRTZyV8I9X94GkJ0FGu+xGrJ/OFzCKU1u8AQlFn7mXsOsZcSwTBoxeGb5Kp/8ZUnwoF7Nh/Id6btpmhwFJ/eXQ9qsbJnV9EaTgO5Vs54= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731243368; c=relaxed/simple; bh=BAyhpzBQ9Ef/MbkX9gfjeCDwrFqqR0VDPviUr9i5+Po=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d3m7lA2a8EXBRmLQNUY11KxjIA9+D8T7W0aa9YRlm1KEXSDvo7AER8XzoCwpJlzCwbz5hCTls1wJ/B7wFwlSL7UNQLbUR1C/HiOpnG5rzv5jL7/qiTz66q5BSmt8YQY/wMaU6cDca8yIWKsnd8h7l8+bnHSWdEPxDvuH8wOjHso= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e290222fdd0so3573952276.2 for <gcc-patches@gcc.gnu.org>; Sun, 10 Nov 2024 04:55:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731243357; x=1731848157; darn=gcc.gnu.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=SXysPPFAljhWPPhCmacYQkfKfwejyU/Muzs088GVOsE=; b=Ot+mJh8U220aATjZBHuiPT6hpSvEfh+n8hdMJSPtGYBYZRUbGOqUsZSQp9YRTAXsoa IfROJOA4JJREj1nVclSynDdGV2uQa9eB6RBnl+SQB95THqjBCd0Fv3jrIe8xtY19QnDX AR2349tO0Jo3tebLFMviJW+28PSO4Rl+P5w+kan94bbL6KXWXSHWfPZO4KXOtI1BjVeX kwyS/h33OBDoj27S3btVxGjYlq2q1kGxUO3B/aOLin+PSwnJEwb61uichgWJDyHtc66T AC1paAIVB9QGAUyhA3I59trb+ojqb6I2A/n3mUPf1dp9KXfO7AEvCiNBZA6LC/oOkEgl BmBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731243357; x=1731848157; 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=SXysPPFAljhWPPhCmacYQkfKfwejyU/Muzs088GVOsE=; b=LYn0NmG6eTJPtecI/zTjxNcK7prwxOFCjL343Vpz5iW5k/cUQGD7G4D3MfRsvNrHPc 3tKUAAsA5Yony8aotA6g9E7jaXb260MwobPBP4hsV6aX06DWIVU9eSodcEh2YCBA8+dL WZcF+Y0f49P74UyLHeWnDVmvP/hEf14N6UI9H9zsYfMvjPAkcb9wN8xEVeLzhd/P9xVH uL83L6pEuu6095EszNB7CBW31hUBYGs26+YtIIS8u7czdglSteEmCl4xahlN23+HB1EA x0tvmIeM46rw68vvtsNApEoPU22FvecH/eE2ZtXfWhMTHT04GjvDJ2T6o5HcDnOAeZWX 8HxA== X-Gm-Message-State: AOJu0Yw4y/7b1dbfFl6bmMCX+26PsCXIYe5GFhF+NYz0kj3y+KT+hx73 gvDwh4RtFTxqVDeBnb9Yxop+BnFAOyQjLLgq6ZsFi18Q+uBD1MxS5ZBMsb9VyM98xQ== X-Google-Smtp-Source: AGHT+IGWGJqGrEtcN+P3w4zVFVC8fdHPAveM1KtBYZV0EUWq8dLgATO/m6kvVUsD44s1lmrN5r1yDw== X-Received: by 2002:a05:6902:26ca:b0:e33:2db4:bc0b with SMTP id 3f1490d57ef6-e337f8da5ecmr6380702276.50.1731243356966; Sun, 10 Nov 2024 04:55:56 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.142.161]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e336f1ed149sm1597758276.49.2024.11.10.04.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2024 04:55:56 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id A2CABC031A; Sun, 10 Nov 2024 20:55:50 +0800 (CST) From: "H.J. Lu" <hjl.tools@gmail.com> To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, ubizjak@gmail.com, hongtao.liu@intel.com Subject: [PATCH v3 3/7] i386: Use GET_MODE with lowpart_subreg Date: Sun, 10 Nov 2024 20:55:46 +0800 Message-ID: <20241110125550.787007-4-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241110125550.787007-1-hjl.tools@gmail.com> References: <20241110125550.787007-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
Improve outgoing integer argument promotion
|
expand
|
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index ce887d96f6a..4c7aa316ae5 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -15532,7 +15532,8 @@ rdseed_step: op0 = copy_to_mode_reg (GET_MODE (op0), op0); emit_insn (gen (half, op0)); op0 = half; - op3 = lowpart_subreg (QImode, op3, HImode); + if (!CONST_INT_P (op3)) + op3 = lowpart_subreg (QImode, op3, GET_MODE (op3)); break; case IX86_BUILTIN_GATHER3ALTDIV8SF: case IX86_BUILTIN_GATHER3ALTDIV8SI:
With expand_promote_outgoing_argument, op3 in op3 = lowpart_subreg (QImode, op3, HImode); may not be in HImode. Call lowpart_subreg on op3 only if it isn't integer constant and pass GET_MODE (op3) to lowpart_subreg instead of HImode. PR middle-end/14907 * config/i386/i386-expand.cc (ix86_expand_builtin): Use GET_MODE with lowpart_subreg. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> --- gcc/config/i386/i386-expand.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)