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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
unsigned int shl0(unsigned int x)
{
return x << 15 << 15;
}
unsigned int shl1(unsigned int x)
{
return x << 16 << 15;
}
unsigned int shl2(unsigned int x)
{
return x << 16 << 16;
}
unsigned int shl3(unsigned int x)
{
return x << 12 << 10 << 10;
}
unsigned int lsr0(unsigned int x)
{
return x >> 15 >> 15;
}
unsigned int lsr1(unsigned int x)
{
return x >> 16 >> 15;
}
unsigned int lsr2(unsigned int x)
{
return x >> 16 >> 16;
}
unsigned int lsr3(unsigned int x)
{
return x >> 12 >> 10 >> 10;
}
int asr0(int x)
{
return x >> 15 >> 15;
}
int asr1(int x)
{
return x >> 16 >> 15;
}
int asr2(int x)
{
return x >> 16 >> 16;
}
int asr3(int x)
{
return x >> 12 >> 10 >> 10;
}
/*
* check-name: shift-shift
* check-command: test-linearize -Wno-decl $file
*
* check-output-start
shl0:
.L0:
<entry-point>
shl.32 %r3 <- %arg1, $30
ret.32 %r3
shl1:
.L2:
<entry-point>
shl.32 %r7 <- %arg1, $31
ret.32 %r7
shl2:
.L4:
<entry-point>
ret.32 $0
shl3:
.L6:
<entry-point>
ret.32 $0
lsr0:
.L8:
<entry-point>
lsr.32 %r20 <- %arg1, $30
ret.32 %r20
lsr1:
.L10:
<entry-point>
lsr.32 %r24 <- %arg1, $31
ret.32 %r24
lsr2:
.L12:
<entry-point>
ret.32 $0
lsr3:
.L14:
<entry-point>
ret.32 $0
asr0:
.L16:
<entry-point>
asr.32 %r37 <- %arg1, $30
ret.32 %r37
asr1:
.L18:
<entry-point>
asr.32 %r41 <- %arg1, $31
ret.32 %r41
asr2:
.L20:
<entry-point>
asr.32 %r45 <- %arg1, $31
ret.32 %r45
asr3:
.L22:
<entry-point>
asr.32 %r50 <- %arg1, $31
ret.32 %r50
* check-output-end
*/
|