blob: bda3f0e474d5b51d11136b60db7205568510e66c (
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
|
/* { dg-do compile } */
/* { dg-options "-march=rv64gc_zbb -mabi=lp64d -fno-lto -O2" } */
/* { dg-skip-if "" { *-*-* } { "-g" } } */
/* { dg-final { check-function-bodies "**" "" } } */
/* { dg-final { scan-assembler-not "and" } } */
/*
**foo1:
** rori a0,a0,34
** ret
*/
unsigned long foo1 (unsigned long rs1)
{
unsigned long tempt;
tempt = rs1 >> 30;
tempt = tempt << 2;
tempt = tempt >> 6;
rs1 = tempt | (rs1 << 30);
return rs1 ;
}
/*
**foo2:
** rori a0,a0,24
** ret
*/
unsigned long foo2 (unsigned long rs1)
{
unsigned long tempt;
tempt = rs1 >> 20;
tempt = tempt << 2;
tempt = tempt >> 6;
rs1 = tempt | (rs1 << 40);
return rs1 ;
}
/*
**foo3:
** rori a0,a0,40
** ret
*/
unsigned long foo3 (unsigned long rs1)
{
unsigned long tempt;
tempt = rs1 << 20;
tempt = tempt >> 2;
tempt = tempt << 6;
rs1 = tempt | (rs1 >> 40);
return rs1 ;
}
/*
**foo4:
** rori a0,a0,20
** ret
*/
unsigned long foo4 (unsigned long rs1)
{
unsigned long tempt;
tempt = rs1 << 40;
tempt = tempt >> 2;
tempt = tempt << 6;
rs1 = tempt | (rs1 >> 20);
return rs1 ;
}
|