blob: 1d6ba807b12f11db449cc8da6b5ec4b932c6a650 (
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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
/* { dg-options "-O3 -mcpu=v6.00.a -mcpu=v6.00.a" } */
volatile int m1, m2, m3;
volatile long l1, l2;
volatile long long llp;
volatile unsigned int u1, u2, u3;
volatile unsigned long ul1, ul2;
volatile unsigned long long ullp;
int test_mul () {
/* { dg-final { scan-assembler-not "mul\tr" } } */
m1 = m2 * m3 ;
/* { dg-final { scan-assembler-not "muli" } } */
m3 = m1 * 1234 ;
/* { dg-final { scan-assembler-not "mulh" } } */
llp = ((long long)l1 * l2);
/* { dg-final { scan-assembler-not "mulhu" } } */
ullp = ((unsigned long long)ul1 * ul2);
/* { dg-final { scan-assembler-not "mulhsu" } } */
llp = ((long long)l1 * ul2);
/* { dg-final { scan-assembler-not "bslli" } } */
m3 = m2 << 25;
/* { dg-final { scan-assembler-not "bsll" } } */
m2 = m1 << m3;
/* { dg-final { scan-assembler-not "bsrai" } } */
m3 = m2 >> 25;
/* { dg-final { scan-assembler-not "bsra" } } */
m2 = m1 >> m3;
/* { dg-final { scan-assembler-not "idiv" } } */
m1 = m2 / m1;
/* { dg-final { scan-assembler-not "idivu" } } */
u1 = u2 / u3;
/* { dg-final { scan-assembler-not "pcmpne" } } */
m3 = (m3 != m1);
/* { dg-final { scan-assembler-not "pcmpeq" } } */
return (m1 == m2);
}
volatile float f1, f2, f3;
void float_func ()
{
/* { dg-final { scan-assembler-not "fmul" } } */
f1 = f2 * f3;
/* { dg-final { scan-assembler-not "fadd" } } */
f1 = f2 + f3;
/* { dg-final { scan-assembler-not "frsub" } } */
f1 = f2 - f3;
/* { dg-final { scan-assembler-not "fdiv" } } */
f1 = f2 / f3;
}
void float_cmp_func ()
{
/* { dg-final { scan-assembler-not "fcmp" } } */
if (f2 <= f3)
print ("le");
else if (f2 == f3)
print ("eq");
else if (f2 < f3)
print ("lt");
else if (f2 > f3)
print ("gt");
else if (f2 >= f3)
print ("ge");
else if (f2 != f3)
print ("ne");
}
|