代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gcc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From dbcb2630c426c8dd2117b5ce625da8422dd8cd65 Mon Sep 17 00:00:00 2001
From: Diachkov Ilia <diachkov.ilia1@huawei-partners.com>
Date: Thu, 22 Feb 2024 17:20:17 +0800
Subject: [PATCH 14/18] Add new pattern to pass the maxmin tests
---
gcc/match.pd | 24 ++++++++++++++++++++++++
gcc/testsuite/gcc.dg/combine-maxmin.c | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/gcc/match.pd b/gcc/match.pd
index 3a19e93b3..aee58e47b 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -8038,6 +8038,10 @@ and,
(match (minmax_cmp_arg @0 @1)
(bit_and @0 INTEGER_CST@1)
(if (wi::popcount (~wi::to_widest (@1) + 1) == 1)))
+/* Match ((unsigned) a > 0b0..01..1) pattern. */
+(match (minmax_cmp_arg1 @0 @1)
+ (gt @0 INTEGER_CST@1)
+ (if (wi::popcount (wi::to_widest (@1) + 1) == 1)))
/* Match (inversed_sign_bit >> sign_bit_pos) pattern.
This statement is blocking for the transformation of unsigned integers.
@@ -8095,6 +8099,26 @@ and,
(convert (min (max @0 { integer_zero_node; })
{ mask; })))))
+ (simplify
+ (convert
+ (cond
+ (minmax_cmp_arg1 (convert? @0) INTEGER_CST@1)
+ (convert? (minmax_sat_arg @0))
+ (convert? @0)))
+ (if (wi::geu_p (wi::to_widest (@1) + 1, TYPE_PRECISION (type)))
+ (with { tree mask = build_int_cst (integer_type_node, tree_to_shwi (@1)); }
+ (convert (min (max (convert:integer_type_node @0) { integer_zero_node; })
+ { mask; })))))
+ (simplify
+ (cond
+ (minmax_cmp_arg1 (convert? @0) INTEGER_CST@1)
+ (convert? (minmax_sat_arg @0))
+ (convert? @0))
+ (if (wi::geu_p (wi::to_widest (@1) + 1, TYPE_PRECISION (type)))
+ (with { tree mask = build_int_cst (integer_type_node, tree_to_shwi (@1)); }
+ (convert (min (max (convert:integer_type_node @0) { integer_zero_node; })
+ { mask; })))))
+
/* Truncation via bit_and with mask. Same concerns on convert? here. */
(simplify
(convert
diff --git a/gcc/testsuite/gcc.dg/combine-maxmin.c b/gcc/testsuite/gcc.dg/combine-maxmin.c
index a984fa560..5c0c9cc49 100755
--- a/gcc/testsuite/gcc.dg/combine-maxmin.c
+++ b/gcc/testsuite/gcc.dg/combine-maxmin.c
@@ -52,4 +52,4 @@ void hf (uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src,
/* { dg-final { scan-assembler-times {[us]min\t} 6 } } */
/* All of the vectorized patterns are expected to be matched. */
/* { dg-final { scan-assembler-not {cmtst\t} } } */
-/* { dg-final { scan-assembler-times {uzp1\t} 5 } } */
+/* { dg-final { scan-assembler-times {uzp1\t} 2 } } */
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。