| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-dse2 -Wno-psabi" } */ |
| 3 |
|
| 4 |
typedef int v4si __attribute__((vector_size(4 * sizeof(int)))); |
| 5 |
|
| 6 |
/* Generic */ |
| 7 |
__attribute__((noipa)) int |
| 8 |
t1 (int a, int b, int c) |
| 9 |
{ |
| 10 |
return ((a ^ c) & b) | a; |
| 11 |
} |
| 12 |
|
| 13 |
__attribute__((noipa)) unsigned int |
| 14 |
t2 (int a, unsigned int b, int c) |
| 15 |
{ |
| 16 |
return ((a ^ c) & b) | a; |
| 17 |
} |
| 18 |
|
| 19 |
__attribute__((noipa)) unsigned long |
| 20 |
t3 (unsigned long a, long b, unsigned long c) |
| 21 |
{ |
| 22 |
return ((a ^ c) & b) | a; |
| 23 |
} |
| 24 |
|
| 25 |
__attribute__((noipa)) unsigned short |
| 26 |
t4 (short a, unsigned short b, unsigned short c) |
| 27 |
{ |
| 28 |
return (unsigned short) ((a ^ c) & b) | a; |
| 29 |
} |
| 30 |
|
| 31 |
__attribute__((noipa)) unsigned char |
| 32 |
t5 (unsigned char a, signed char b, signed char c) |
| 33 |
{ |
| 34 |
return ((a ^ c) & b) | a; |
| 35 |
} |
| 36 |
|
| 37 |
__attribute__((noipa)) long long |
| 38 |
t6 (long long a, long long b, long long c) |
| 39 |
{ |
| 40 |
return ((a ^ c) & (unsigned long long) b) | a; |
| 41 |
} |
| 42 |
|
| 43 |
/* Gimple */ |
| 44 |
__attribute__((noipa)) int |
| 45 |
t7 (int a, int b, int c) |
| 46 |
{ |
| 47 |
int t1 = a ^ c; |
| 48 |
int t2 = t1 & b; |
| 49 |
int t3 = t2 | a; |
| 50 |
return t3; |
| 51 |
} |
| 52 |
|
| 53 |
__attribute__((noipa)) int |
| 54 |
t8 (int a, unsigned int b, unsigned int c) |
| 55 |
{ |
| 56 |
unsigned int t1 = a ^ c; |
| 57 |
int t2 = t1 & b; |
| 58 |
int t3 = t2 | a; |
| 59 |
return t3; |
| 60 |
} |
| 61 |
|
| 62 |
__attribute__((noipa)) unsigned int |
| 63 |
t9 (unsigned int a, unsigned int b, int c) |
| 64 |
{ |
| 65 |
unsigned int t1 = a ^ c; |
| 66 |
unsigned int t2 = t1 & b; |
| 67 |
unsigned int t3 = t2 | a; |
| 68 |
return t3; |
| 69 |
} |
| 70 |
|
| 71 |
__attribute__((noipa)) unsigned long |
| 72 |
t10 (unsigned long a, long b, unsigned long c) |
| 73 |
{ |
| 74 |
unsigned long t1 = a ^ c; |
| 75 |
unsigned long t2 = t1 & b; |
| 76 |
unsigned long t3 = t2 | a; |
| 77 |
return t3; |
| 78 |
} |
| 79 |
|
| 80 |
__attribute__((noipa)) unsigned short |
| 81 |
t11 (short a, unsigned short b, short c) |
| 82 |
{ |
| 83 |
short t1 = a ^ c; |
| 84 |
unsigned short t2 = t1 & b; |
| 85 |
unsigned short t3 = t2 | a; |
| 86 |
return t3; |
| 87 |
} |
| 88 |
|
| 89 |
__attribute__((noipa)) unsigned char |
| 90 |
t12 (signed char a, unsigned char b, signed char c) |
| 91 |
{ |
| 92 |
unsigned char t1 = a ^ c; |
| 93 |
unsigned char t2 = t1 & b; |
| 94 |
unsigned char t3 = t2 | a; |
| 95 |
return t3; |
| 96 |
} |
| 97 |
|
| 98 |
__attribute__((noipa)) unsigned long long |
| 99 |
t13 (unsigned long long a, long long b, unsigned long long c) |
| 100 |
{ |
| 101 |
long long t1 = a ^ c; |
| 102 |
long long t2 = t1 & b; |
| 103 |
unsigned long long t3 = t2 | a; |
| 104 |
return t3; |
| 105 |
} |
| 106 |
|
| 107 |
/* Vectors */ |
| 108 |
__attribute__((noipa)) v4si |
| 109 |
t14 (v4si a, v4si b, v4si c) |
| 110 |
{ |
| 111 |
return ((a ^ c) & b) | a; |
| 112 |
} |
| 113 |
|
| 114 |
__attribute__((noipa)) v4si |
| 115 |
t15 (v4si a, v4si b, v4si c) |
| 116 |
{ |
| 117 |
v4si t1 = a ^ c; |
| 118 |
v4si t2 = t1 & b; |
| 119 |
v4si t3 = t2 | a; |
| 120 |
return t3; |
| 121 |
} |
| 122 |
|
| 123 |
/* { dg-final { scan-tree-dump-not " \\\^ " "dse2" } } */ |
| 124 |
/* { dg-final { scan-tree-dump-times " \\\| " 15 "dse2" } } */ |
| 125 |
/* { dg-final { scan-tree-dump-times " & " 15 "dse2" } } */ |