blob: 2d1909a42c57e60fdffe74ed85aeb2d3d9694e70 [file] [log] [blame]
Andrew Lenhartha5cc38b2006-06-04 00:25:51 +00001%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2Fix Ordered/Unordered FP stuff
3
4
5%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6improve bytezap opertunities
7ulong %foo(ulong %y) {
8entry:
9 %tmp = and ulong %y, 65535
10 %tmp2 = shr ulong %tmp, ubyte 3
11 ret ulong %tmp2
12}
13
14
15compiles to a 3 instruction sequence without instcombine
16 zapnot $16,3,$0
17 srl $0,3,$0
18 ret $31,($26),1
19
20After instcombine you get
21ulong %foo(ulong %y) {
22entry:
23 %tmp = shr ulong %y, ubyte 3 ; <ulong> [#uses=1]
24 %tmp2 = and ulong %tmp, 8191 ; <ulong> [#uses=1]
25 ret ulong %tmp2
26}
27
28which compiles to
29 lda $0,8191($31)
30 srl $16,3,$1
31 and $1,$0,$0
32 ret $31,($26),1
33