-
Notifications
You must be signed in to change notification settings - Fork 16
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
math: Fix sqrt calc on IA32 #282
Conversation
7ab5dbf
to
71504c7
Compare
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.
LGTM, passed my sqrt tests, which soon will be in review
Small comment. Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 1: Basic Architecture8.1.5.1 x87 FPU Floating-Point Exception Mask BitsThe exception-flag mask bits (bits 0 through 5 of the x87 FPU control word) mask the 6 floating-point exception |
You're right, in the meantime I modified this a bit: to inherit the control word settings except the ones I want to set (RC, PC). This change was posted to test if it fixes the issue. I will push a patch-set regarding the changes I write about, I will be grateful if you take a look. |
71504c7
to
4693e9c
Compare
This change assumes that the `fsqrt` calculation is performed for double precision FP and rounded to the nearest (even) value. To achieve this, the FPU control word is set accordingly at the sqrt computation time. All other settings in FPU control word are inherited (not changed). JIRA: RTOS-562
4693e9c
to
e44bb1b
Compare
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.
LGTM
This change assumes that the
fsqrt
calculation is performed for double precision FP and rounded to the nearest (even) value. To achieve this, the FPU control word is set accordingly at the sqrt computation time.All exceptions are enabled: any underflow, overflow, /0, invalid precission, etc during sqrt calculation will throw an exception.All other settings (exceptions mask, infinity control) in FPU control word are inherited (not changed).
Fixes phoenix-rtos/phoenix-rtos-project#800
JIRA: RTOS-562
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment