File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 .section .text
44 .global __lshrs
55 .type __lshrs, @function
6- .global __lshrs.hijack_lshru
7- .type __lshrs.hijack_lshru, @function
86
97.ifdef PREFER_OS_CRT
108
@@ -27,6 +25,7 @@ __lshrs:
2725 add hl, sp
2826.L.loop:
2927 sra a
28+ .local __lshrs.hijack_lshru
3029__lshrs.hijack_lshru:
3130 inc hl
3231 inc hl
@@ -40,4 +39,33 @@ __lshrs.hijack_lshru:
4039 pop hl
4140 ret
4241
42+ .endif
43+
44+ .section .text
45+ .global __lshru
46+ .type __lshru, @function
47+
48+ .ifdef PREFER_OS_CRT
49+
50+ .set __lshru, 0x0001EC
51+
52+ .else
53+
54+ __lshru:
55+ ; Suboptimal for large shift amounts
56+ ; CC: if C!=0: C*(15*r(PC)+3*r(SPL)+3*w(SPL)+4)+17*r(PC)+9*r(SPL)+6*w(SPL)+2
57+ ; if C==0: 4*r(PC)+3*r(SPL)+2
58+ inc l
59+ dec l
60+ ret z
61+ push hl
62+ push bc
63+ ld b, l
64+ or a, a
65+ sbc hl, hl
66+ add hl, sp
67+ .L.loop:
68+ srl a
69+ jr __lshrs.hijack_lshru
70+
4371.endif
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments