Skip to content

Commit 3e2a7b8

Browse files
calc84maniacmateoconlechuga
authored andcommitted
Optimize copysign
1 parent d3c7f67 commit 3e2a7b8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/libc/copysign.src

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
_copysign:
66
_copysignf:
77
pop bc
8-
pop hl
9-
pop de
10-
ld a,e
11-
pop de
128
pop de
13-
push de
14-
push de
15-
push de
9+
pop hl
10+
ld a,l
11+
inc sp
12+
ex (sp),hl
13+
dec sp
1614
push hl
15+
push de
1716
push bc
18-
xor a,e
19-
and a,$7F
20-
xor a,e
21-
ld e,a
17+
add hl,hl
18+
rla
19+
rrca
20+
ld l,a
21+
ex de,hl
2222
ret
23-

0 commit comments

Comments
 (0)