-
Notifications
You must be signed in to change notification settings - Fork 140
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
aarch64/fenv: fix fenv_t
#319
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Do we want to sync Seems there are some bugs: openlibm/include/openlibm_fenv_arm.h Lines 65 to 67 in 5a88ede
/* We need to be able to map status flag positions to mask flag positions */
#ifndef __ARM_PCS_VFP
#define _FPUSW_SHIFT 16
#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT)
#endif And FreeBSD doesn't use #else /* __ARM_PCS_VFP */
...
#define _FPU_MASK_SHIFT 8 |
#define __mrs_fpcr(__r) __asm __volatile("mrs %0, fpcr" : "=r" (__r)) | ||
#define __msr_fpcr(__r) __asm __volatile("msr fpcr, %0" : : "r" (__r)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to rename those functions to __read_fpcr
, __write_fpcr
.
Or reg_fpcr_read()
, reg_fpsr_write()
(NetBSD style)
AArch64 has two 64bit regs, AArch32 only has one.
The high 32 bits of both registers are reserved, so we only need to save the low 32 bits and pack them into a uint64.
aarch64/fenv.h
from FreeBSDhttps://github.com/freebsd/freebsd-src/blob/de1aa3dab23c06fec962a14da3e7b4755c5880cf/lib/msun/aarch64/fenv.h
Fix #278