Allows to control the global floating point unit configuration (fp environment). A thread inherits the configuration from the creator thread at start up. Changes to the fpu settings are local to this thread.
FloatingPointUnit | Allows to control the global floating point unit configuration (fp environment). |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file FloatingPointUnit. |
C-kern/ | Implementation file FloatingPointUnit impl. |
Enumerations | |
fpu_except_e | |
Functions | |
test | |
unittest_math_fpu | Tests configuration interface of floating point unit. |
fpuexcept | |
query | |
getsignaled_fpuexcept | Returns signaled interrupt flags fpu register value. |
getenabled_fpuexcept | Returns interrupt mask fpu register value. |
enable | |
enable_fpuexcept | Enables a fpu exception to generate an interrupt. |
disable_fpuexcept | Disables a fpu exception to be silent. |
signal | |
signal_fpuexcept | Signals an exceptional condition. |
clear_fpuexcept | Clears the flags indicating an exceptional condition. |
inline implementation | |
Macros | |
getenabled_fpuexcept | Implements <fpuexcept.getenabled_fpuexcept>. |
getsignaled_fpuexcept | Implements <fpuexcept.getsignaled_fpuexcept>. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2012 Jörg Seebohn
Header file FloatingPointUnit.
Implementation file FloatingPointUnit impl.
test | |
unittest_math_fpu | Tests configuration interface of floating point unit. |
query | |
getsignaled_fpuexcept | Returns signaled interrupt flags fpu register value. |
getenabled_fpuexcept | Returns interrupt mask fpu register value. |
enable | |
enable_fpuexcept | Enables a fpu exception to generate an interrupt. |
disable_fpuexcept | Disables a fpu exception to be silent. |
signal | |
signal_fpuexcept | Signals an exceptional condition. |
clear_fpuexcept | Clears the flags indicating an exceptional condition. |
fpu_except_e getsignaled_fpuexcept( fpu_except_e exception_mask )
Returns signaled interrupt flags fpu register value. For every raised exception the corresponding bit in the return value is set. See fpu_except_e for a list of all possible bits. For every enumerated value in fpu_except_e this function can return its value only if it was disabled (not throwing exception). For enabled exceptions an interrupt is generated. Once an exception was signaled the bit is sticky and can only be cleared with a call to clear_fpuexcept.
fpu_except_e getenabled_fpuexcept( void )
Returns interrupt mask fpu register value. For every enabled exception the corresponding bit is set in the return value of this function. If an enabled exception occurs an interrupt is generated and the thread is stopped. Exceptions can be enabled with a call to enable_fpuexcept and disabled with a call to disable_fpuexcept. Disabled exceptions do not generate any interrupt but silently set a signaled bit in case they occured. The bits can be read with a call to getsignaled_fpuexcept.
int enable_fpuexcept( fpu_except_e exception_flags )
Enables a fpu exception to generate an interrupt. The parameter exception_flags can be used to enable more than one exception by oring together the values from fpu_except_e. Once enabled this status for an exception can only be changed by calling disable_fpuexcept. If an enabled exception occurs an interrupt is generated and the thread is stopped.
int disable_fpuexcept( fpu_except_e exception_flags )
Disables a fpu exception to be silent. Once disabled this status for an exception can only be changed by calling enable_fpuexcept. Disabled exceptions do not generate any interrupt but silently set a signaling bit in case they occur. The signaled bits can be read with a call to getsignaled_fpuexcept.
int signal_fpuexcept( fpu_except_e exception_flags )
Signals an exceptional condition. More than one exception can be signaled by oring together different fpu_except_e. In case of an enabled exception an interrupt is generated else the corresponding signaled bit is set which can be read by calling getsignaled_fpuexcept.
int clear_fpuexcept( fpu_except_e exception_flags )
Clears the flags indicating an exceptional condition. More than one exceptional state can be cleared by oring together different fpu_except_e. This function is only useful for disabled exceptions to clear the bits returned by a call to getsignaled_fpuexcept.
Macros | |
getenabled_fpuexcept | Implements <fpuexcept.getenabled_fpuexcept>. |
getsignaled_fpuexcept | Implements <fpuexcept.getsignaled_fpuexcept>. |
Tests configuration interface of floating point unit.
int unittest_math_fpu( void )
Returns signaled interrupt flags fpu register value.
fpu_except_e getsignaled_fpuexcept( fpu_except_e exception_mask )
Returns interrupt mask fpu register value.
fpu_except_e getenabled_fpuexcept( void )
Enables a fpu exception to generate an interrupt.
int enable_fpuexcept( fpu_except_e exception_flags )
Disables a fpu exception to be silent.
int disable_fpuexcept( fpu_except_e exception_flags )
Signals an exceptional condition.
int signal_fpuexcept( fpu_except_e exception_flags )
Clears the flags indicating an exceptional condition.
int clear_fpuexcept( fpu_except_e exception_flags )