Skip to content

Optimized __setflag, removed float64_to_int.c #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZERICO2005
Copy link
Contributor

The compiler will emit call pe, __setflag after signed comparisons. I have added our own faster implementation of __setflag to the CRT.

__setflag:
	ret	po
; __invertflag:
	push	af
	ex	(sp), hl
	ld	a, l
	xor	a, $80	; invert S flag
	ld	l, a
	ex	(sp), hl
	pop	af
	ret

Since the compiler only appears to emit call pe, __setflag instead of call __setflag, it might be better to have it call __invertflag so it can skip ret po

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant