From patchwork Wed Jul 31 11:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filip Kastl X-Patchwork-Id: 1967071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=CEgnS8vZ; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VsWDZpfF; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=CEgnS8vZ; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=VsWDZpfF; 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 4WYqhG41sXz1yYq for ; Wed, 31 Jul 2024 21:32:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3787D385828B for ; Wed, 31 Jul 2024 11:32:28 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 447C43858430 for ; Wed, 31 Jul 2024 11:32:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 447C43858430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 447C43858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722425529; cv=none; b=eLIbk0Ol1xv+JOrxyEGfDY8+WwCVJiidMjGAmt6Mu29lR2wViVtwV6mEamGHAaEoJ4SSZ70G/TCNNGzdF74q/0bNo+8NZ9vCrJ3KuhBMgpJ/+Dho5wyMHjKWGPJtg/aRbQDAsavVhoDE9pi7qhsvjg5Jn0gPFIH/Bjwpeqy4g50= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722425529; c=relaxed/simple; bh=fBOT6NXMP8xi7KtkZwrnyxHWnJmr9P9H2FAFcjjzfks=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=NjKnRC5y/gPYpvQt8eceDyLQM3pD5Y0bkUcWff8Wqh4maNMSB4b6ZcAy+n/scWImIK0SYTFWesjabeee5+PHa7pge3lgT48RXAmp5VI3HDjRQHygpBmCiDxvyr0PmqBB0K2mmGTmy50KGy3HTHqd8TPnHbYIxdvnCO+Jv5VuRgc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3B2B021B7F; Wed, 31 Jul 2024 11:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1722425527; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=clzDrzu1/DCO6DN9sF4U8WXoKNKBi4hoH9poQXs7YOY=; b=CEgnS8vZDhS8rJU3KkR6gU621RpuhvxZGcEs+mt95JKYQuP0FXxJl4p+ELYtZlclp+9s9p WTZ4vd1iKGKZSJZlcpYNo0RpnRtcuM9+iiKKbdRYfPZJ/h7CuCtNYP7YRyqxzRY/gexGCp vRRtcOYD4nElbTM9fxE/2CzafoVfBis= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1722425527; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=clzDrzu1/DCO6DN9sF4U8WXoKNKBi4hoH9poQXs7YOY=; b=VsWDZpfFKMxMs1zbxoQuur37ndng8hI42RWgPhnx8p03m+bhv+sLjyztseiBzYMKtzc7qd 88yVKV75dLD6RMDQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=CEgnS8vZ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=VsWDZpfF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1722425527; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=clzDrzu1/DCO6DN9sF4U8WXoKNKBi4hoH9poQXs7YOY=; b=CEgnS8vZDhS8rJU3KkR6gU621RpuhvxZGcEs+mt95JKYQuP0FXxJl4p+ELYtZlclp+9s9p WTZ4vd1iKGKZSJZlcpYNo0RpnRtcuM9+iiKKbdRYfPZJ/h7CuCtNYP7YRyqxzRY/gexGCp vRRtcOYD4nElbTM9fxE/2CzafoVfBis= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1722425527; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=clzDrzu1/DCO6DN9sF4U8WXoKNKBi4hoH9poQXs7YOY=; b=VsWDZpfFKMxMs1zbxoQuur37ndng8hI42RWgPhnx8p03m+bhv+sLjyztseiBzYMKtzc7qd 88yVKV75dLD6RMDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2BC891368F; Wed, 31 Jul 2024 11:32:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id I3JnCrcgqma8PgAAD6G6ig (envelope-from ); Wed, 31 Jul 2024 11:32:07 +0000 Date: Wed, 31 Jul 2024 13:32:06 +0200 From: Filip Kastl To: Jakub Jelinek Cc: Filip Kastl , gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: [PATCH v2] testsuite: Adjust switch-exp-transform-3.c for 32bit Message-ID: References: <202407302106.46UL6hEw263466@shliclel4214.sh.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-1.31 / 50.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email,suse.cz:dkim]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+] X-Rspamd-Action: no action X-Spam-Score: -1.31 X-Rspamd-Queue-Id: 3B2B021B7F X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org On Wed 2024-07-31 12:18:34, Jakub Jelinek wrote: > On Wed, Jul 31, 2024 at 12:02:08PM +0200, Filip Kastl wrote: > > 32bit x86 CPUs won't natively support the FFS operation on a 64 bit > > type. Therefore, the switch-exp-transform-3.c test will always fail > > with a 32bit target. I'm fixing my mistake. > > > > gcc/testsuite/ChangeLog: > > > > * gcc.target/i386/switch-exp-transform-3.c: Remove code testing > > that the exponential index transform is able to handle long > > long int. > > But for -m64 it does and it is good to test even that. > Can't you wrap the long long stuff with > #ifdef __x86_64__ > and > do > /* { dg-final { scan-tree-dump-times "Applying exponential index transform" 4 "switchconv" { target ia32 } } } */ > /* { dg-final { scan-tree-dump-times "Applying exponential index transform" 6 "switchconv" { target { ! ia32 } } } } */ > or so? > > Jakub > Thanks for the feedback! Here is a second version of the patch. I've tested this version with make check RUNTESTFLAGS="i386.exp=gcc.target/i386/switch-exp-transform-3.c --target_board='unix{-m32}'" and make check RUNTESTFLAGS="i386.exp=gcc.target/i386/switch-exp-transform-3.c" on a x86_64 machine and in both cases the test didn't produce any errors and scan-tree-dump-times was successful. Is this version ok? Thanks, Filip Kastl -- 8< -- testsuite: Adjust switch-exp-transform-3.c for 32bit 32bit x86 CPUs won't natively support the FFS operation on a 64 bit type. Therefore, I'm setting the long long int part of the switch-exp-transform-3.c test to only execute with 64bit targets. gcc/testsuite/ChangeLog: * gcc.target/i386/switch-exp-transform-3.c: Set the long long int test to only execute with 64bit targets. Signed-off-by: Filip Kastl --- gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c b/gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c index c8fae70692e..64a7b146172 100644 --- a/gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c +++ b/gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c @@ -99,6 +99,8 @@ int unopt_unsigned_long(unsigned long bit_position) } } +#ifdef __x86_64__ + int unopt_long_long(long long bit_position) { switch (bit_position) @@ -145,4 +147,7 @@ int unopt_unsigned_long_long(unsigned long long bit_position) } } -/* { dg-final { scan-tree-dump-times "Applying exponential index transform" 6 "switchconv" } } */ +#endif + +/* { dg-final { scan-tree-dump-times "Applying exponential index transform" 4 "switchconv" { target ia32 } } } */ +/* { dg-final { scan-tree-dump-times "Applying exponential index transform" 6 "switchconv" { target { ! ia32 } } } } */