blob: 3b54c32958608ac056014b910e53568561bf72fe (
plain)
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
|
/* { dg-do compile } */
/* { dg-final { scan-assembler-not "and.d " } } */
/* { dg-final { scan-assembler-not "move.d " } } */
/* { dg-final { scan-assembler "cLear.b" } } */
/* { dg-final { scan-assembler "movu.b" } } */
/* { dg-final { scan-assembler "and.b" } } */
/* { dg-final { scan-assembler "movu.w" } } */
/* { dg-final { scan-assembler "and.w" } } */
/* { dg-final { scan-assembler "andq" } } */
/* { dg-options "-O2" } */
/* Test the "andu" peephole2 trivially, memory operand. */
int
clearb (int x, int *y)
{
return *y & 0xff00;
}
int
andb (int x, int *y)
{
return *y & 0x3f;
}
int
andw (int x, int *y)
{
return *y & 0xfff;
}
int
andq (int x, int *y)
{
return *y & 0xf0;
}
int
andq2 (int x, int *y)
{
return *y & 0xfff0;
}
|