From patchwork Thu Oct 31 06:27:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 2004550 Return-Path: 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=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=PuHwOYA5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4XfDfl4YWFz1xwF for ; Thu, 31 Oct 2024 17:31:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A187D3857707 for ; Thu, 31 Oct 2024 06:31:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by sourceware.org (Postfix) with ESMTPS id D2F75385783B for ; Thu, 31 Oct 2024 06:29:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2F75385783B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D2F75385783B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730356199; cv=none; b=JWJXswzkoRzZQHIxIngyL3g3KRFPPWTh2t41QNc5ezkJuhFTq6z/0Z5lCEwQya9GWEpa/JUb0pz2mLoCILvwXc2LdFi0V9DGekimW71sC9H7L8B9wQFtvs7wrpRrB6piTwOHxYOXXn7L8kCvxjmBYPuvzw7zw2fhe13DJOgvozo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730356199; c=relaxed/simple; bh=Mj8RmIbdF9Gxp32MvTUpoDtCiLivsDVZC9k99Rian2A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Hyg6FOSOwh1BSe34fYue7VVyVEApzlsfGhO+ig9ljfOEiXrrGbaZZo3Q2Hd7YnznvYjX/gD4IER6XhobeNNOZaLYD7Uc2MaAChrDEZVFb0Ix+FLidO+y8Mu3DkQi3WMpsqDUPAj7mPW6E0nMnkko8yUpypvXlHKOe4iU6T6wK/Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730356191; x=1761892191; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mj8RmIbdF9Gxp32MvTUpoDtCiLivsDVZC9k99Rian2A=; b=PuHwOYA5qEtT908d5HHrlvedhPAKvHHlj3IFgm2UzDbHIrMh1+iNQb5m 6HoWVBg4D7IKKxj1wra+iaO18TUmIn6nr2pb8t1SI1LbTH49ainEKlI9p rSU71VTwR0WmEKuRMYoWM9FyPScLmJ4JBzkGLzLrc8uBvSCeTwlz1Asr6 pHmGokmlNs72QPE3yyfYyEU7q6cMRodH/p7mPSvRN31t09wiuUIKqZloy n4JmHPutFglbZpWPxsO764xJZcDiyi+NFYzuskX0hxMOxUiZg57IvWjPa 9T2Wk5srqeEx2d82sMv/I8KuuYfsjcbYBSU5y5+NWQojE1E+mJfnRU4je A==; X-CSE-ConnectionGUID: 8jtfYoubTd61zHxq1hLm/g== X-CSE-MsgGUID: /GkuTpPZRv6lJXYWM6yiNw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30238447" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30238447" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 23:29:50 -0700 X-CSE-ConnectionGUID: g4bvldzdRBWeW+domgVLPQ== X-CSE-MsgGUID: MJH+bFm/Rb6HpYTXskUgIw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,247,1725346800"; d="scan'208";a="82455055" Received: from panli.sh.intel.com ([10.239.154.73]) by orviesa010.jf.intel.com with ESMTP; 30 Oct 2024 23:29:48 -0700 From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, Tamar.Christina@arm.com, juzhe.zhong@rivai.ai, kito.cheng@gmail.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Pan Li Subject: [PATCH v2 06/10] Test: Move unsigned integer SAT_ADD simplify testcases to gcc.dg Date: Thu, 31 Oct 2024 14:27:38 +0800 Message-ID: <20241031062742.2709845-6-pan2.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241031062742.2709845-1-pan2.li@intel.com> References: <20241031062742.2709845-1-pan2.li@intel.com> MIME-Version: 1.0 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 From: Pan Li As suggested by Richard, move the SAT_ADD simplify testcases from the tree-ssa to gcc.dg. gcc/testsuite/ChangeLog: * gcc.dg/sat_arith_simplify.h: Add test macros. * gcc.dg/tree-ssa/sat_u_add-simplify-1-u16.c: Move to... * gcc.dg/sat_u_add-simplify-1-u16.c: ...here. * gcc.dg/tree-ssa/sat_u_add-simplify-1-u32.c: Move to... * gcc.dg/sat_u_add-simplify-1-u32.c: ...here. * gcc.dg/tree-ssa/sat_u_add-simplify-1-u64.c: Move to... * gcc.dg/sat_u_add-simplify-1-u64.c: ...here. * gcc.dg/tree-ssa/sat_u_add-simplify-1-u8.c: Move to... * gcc.dg/sat_u_add-simplify-1-u8.c: ...here. Signed-off-by: Pan Li --- gcc/testsuite/gcc.dg/sat_arith_simplify.h | 6 ++++++ .../gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u16.c | 8 ++------ .../gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u32.c | 8 ++------ .../gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u64.c | 8 ++------ .../gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u8.c | 8 ++------ 5 files changed, 14 insertions(+), 24 deletions(-) rename gcc/testsuite/gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u16.c (75%) rename gcc/testsuite/gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u32.c (75%) rename gcc/testsuite/gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u64.c (75%) rename gcc/testsuite/gcc.dg/{tree-ssa => }/sat_u_add-simplify-1-u8.c (75%) diff --git a/gcc/testsuite/gcc.dg/sat_arith_simplify.h b/gcc/testsuite/gcc.dg/sat_arith_simplify.h index 89577ffabb1..1d66f6f25e3 100644 --- a/gcc/testsuite/gcc.dg/sat_arith_simplify.h +++ b/gcc/testsuite/gcc.dg/sat_arith_simplify.h @@ -1,6 +1,12 @@ #ifndef HAVE_DEFINED_SAT_ARITH_SIMPLIFY_H #define HAVE_DEFINED_SAT_ARITH_SIMPLIFY_H +#define DEF_SAT_U_ADD_1(T) \ +T sat_u_add_##T##_1 (T x, T y) \ +{ \ + return (T)(x + y) >= x ? (x + y) : -1; \ +} + #define DEF_SAT_U_ADD_2(T) \ T sat_u_add_##T##_2 (T x, T y) \ { \ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u16.c b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u16.c similarity index 75% rename from gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u16.c rename to gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u16.c index 7617fbaca45..bf897f4af59 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u16.c +++ b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u16.c @@ -2,13 +2,9 @@ /* { dg-options "-O2 -fdump-tree-gimple-details" } */ #include +#include "sat_arith_simplify.h" -#define T uint16_t - -T sat_add_u_1 (T x, T y) -{ - return (T)(x + y) >= x ? (x + y) : -1; -} +DEF_SAT_U_ADD_1 (uint16_t) /* { dg-final { scan-tree-dump-not " if " "gimple" } } */ /* { dg-final { scan-tree-dump-not " else " "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u32.c b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u32.c similarity index 75% rename from gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u32.c rename to gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u32.c index efea85bfbb7..0ba1d3e92d7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u32.c +++ b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u32.c @@ -2,13 +2,9 @@ /* { dg-options "-O2 -fdump-tree-gimple-details" } */ #include +#include "sat_arith_simplify.h" -#define T uint32_t - -T sat_add_u_1 (T x, T y) -{ - return (T)(x + y) >= x ? (x + y) : -1; -} +DEF_SAT_U_ADD_1 (uint32_t) /* { dg-final { scan-tree-dump-not " if " "gimple" } } */ /* { dg-final { scan-tree-dump-not " else " "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u64.c b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u64.c similarity index 75% rename from gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u64.c rename to gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u64.c index b7b55d72ede..723799dd612 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u64.c +++ b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u64.c @@ -2,13 +2,9 @@ /* { dg-options "-O2 -fdump-tree-gimple-details" } */ #include +#include "sat_arith_simplify.h" -#define T uint64_t - -T sat_add_u_1 (T x, T y) -{ - return (T)(x + y) >= x ? (x + y) : -1; -} +DEF_SAT_U_ADD_1 (uint64_t) /* { dg-final { scan-tree-dump-not " if " "gimple" } } */ /* { dg-final { scan-tree-dump-not " else " "gimple" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u8.c b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u8.c similarity index 75% rename from gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u8.c rename to gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u8.c index 77e9af3dd29..96e8ecb4af1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sat_u_add-simplify-1-u8.c +++ b/gcc/testsuite/gcc.dg/sat_u_add-simplify-1-u8.c @@ -2,13 +2,9 @@ /* { dg-options "-O2 -fdump-tree-gimple-details" } */ #include +#include "sat_arith_simplify.h" -#define T uint8_t - -T sat_add_u_1 (T x, T y) -{ - return (T)(x + y) >= x ? (x + y) : -1; -} +DEF_SAT_U_ADD_1 (uint8_t) /* { dg-final { scan-tree-dump-not " if " "gimple" } } */ /* { dg-final { scan-tree-dump-not " else " "gimple" } } */