Skip to content
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

tio.fcvt.wu.s #26

Open
jnk0le opened this issue Nov 12, 2023 · 1 comment
Open

tio.fcvt.wu.s #26

jnk0le opened this issue Nov 12, 2023 · 1 comment

Comments

@jnk0le
Copy link
Owner

jnk0le commented Nov 12, 2023

probably highly problematic, replaces only 2 instructions

	fcvt.w.s a1, fa3
	tio.max HRTIM1_TIMA_CMP1xR, a1, zero
@jnk0le jnk0le changed the title fp to int, saturate neg to zero and write to IO tio.fcvt.wu.s Nov 25, 2023
@jnk0le
Copy link
Owner Author

jnk0le commented Nov 25, 2023

or

	fcvt.wu.s a1, fa3
	tio.mv HRTIM1_TIMA_CMP1xR, a1

negative float to unsigned is UB in C/C++ though. Saturation breaks on some archs (e.g. x86)

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

No branches or pull requests

1 participant