1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
From 411792b0bbb63715d8e90d46eb4f0d9c810ce8ba Mon Sep 17 00:00:00 2001
From: Pronin Alexander 00812787 <pronin.alexander@huawei.com>
Date: Tue, 3 Sep 2024 21:26:03 +0800
Subject: [PATCH 2/2] Fix settings for wide operations tests
Signed-off-by: lin-houzhong <hz_lin8@163.com>
---
gcc/testsuite/gcc.dg/double_sized_mul-1.c | 8 +++++---
gcc/testsuite/gcc.dg/double_sized_mul-2.c | 9 +++++----
gcc/testsuite/gcc.dg/uaddsub.c | 6 ++++--
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/double_sized_mul-1.c b/gcc/testsuite/gcc.dg/double_sized_mul-1.c
index d32a25223..b848e02de 100644
--- a/gcc/testsuite/gcc.dg/double_sized_mul-1.c
+++ b/gcc/testsuite/gcc.dg/double_sized_mul-1.c
@@ -1,7 +1,8 @@
-/* { dg-do compile } */
+/* { dg-do compile { target aarch64*-*-* x86_64*-*-*} } */
/* fif-conversion-gimple and fuaddsub-overflow-match-all are required for
proper overflow detection in some cases. */
-/* { dg-options "-O2 -fif-conversion-gimple -march=armv8.2-a -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-options "-O2 -fif-conversion-gimple -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-additional-options "-march=armv8.2-a" { target aarch64*-*-* } } */
#include <stdint.h>
typedef unsigned __int128 uint128_t;
@@ -138,4 +139,5 @@ uint128_t mul128_perm (uint64_t a, uint64_t b)
return res;
}
-/* { dg-final { scan-tree-dump-times "double sized mul optimized: 1" 6 "widening_mul" } } */
+/* { dg-final { scan-tree-dump-times "double sized mul optimized: 1" 6 "widening_mul" { target aarch64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "double sized mul optimized: 1" 4 "widening_mul" { target x86_64*-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/double_sized_mul-2.c b/gcc/testsuite/gcc.dg/double_sized_mul-2.c
index ff35902b7..cf8f0aedd 100644
--- a/gcc/testsuite/gcc.dg/double_sized_mul-2.c
+++ b/gcc/testsuite/gcc.dg/double_sized_mul-2.c
@@ -1,7 +1,8 @@
-/* { dg-do compile } */
-/* fif-conversion-gimple is required for proper overflow detection
- in some cases. */
-/* { dg-options "-O2 -fif-conversion-gimple -march=armv8.2-a -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-do compile { target aarch64*-*-* x86_64*-*-*} } */
+/* fif-conversion-gimple and fuaddsub-overflow-match-all are required for
+ proper overflow detection in some cases. */
+/* { dg-options "-O2 -fif-conversion-gimple -fuaddsub-overflow-match-all -fdump-tree-widening_mul-stats" } */
+/* { dg-additional-options "-march=armv8.2-a" { target aarch64*-*-* } } */
#include <stdint.h>
typedef unsigned __int128 uint128_t;
diff --git a/gcc/testsuite/gcc.dg/uaddsub.c b/gcc/testsuite/gcc.dg/uaddsub.c
index 96c26d308..dcb587fc8 100644
--- a/gcc/testsuite/gcc.dg/uaddsub.c
+++ b/gcc/testsuite/gcc.dg/uaddsub.c
@@ -1,5 +1,6 @@
-/* { dg-do compile } */
+/* { dg-do compile { target aarch64*-*-* x86_64-*-* } } */
/* { dg-options "-O2 -fuaddsub-overflow-match-all -fdump-tree-optimized" } */
+/* { dg-additional-options "-march=armv8.2-a" { target aarch64*-*-* } } */
#include <stdint.h>
typedef unsigned __int128 uint128_t;
@@ -140,4 +141,5 @@ uint256_t sub256 (uint128_t a, uint128_t b)
}
/* { dg-final { scan-tree-dump-times "= .ADD_OVERFLOW \\(a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\)\\)" 5 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "= .SUB_OVERFLOW \\(a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\)\\)" 5 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= .SUB_OVERFLOW \\(a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\)\\)" 5 "optimized" { target aarch64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "= .SUB_OVERFLOW \\(a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\)\\)" 4 "optimized" { target x86_64*-*-* } } } */
--
2.33.0
|