public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Need details about generating traps for floating point exceptions
@ 2019-06-24 11:40 Faisal Riyaz
  2019-09-04 19:53 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Faisal Riyaz @ 2019-06-24 11:40 UTC (permalink / raw)
  To: libc-help

Hi,


I am interested in knowing more about how traps are generated when floating
point exception occur.

Currently, gcc for RISC-V(riscv64-unknown-elf-gcc (GCC) 8.2.0) does not
generate traps on encountering

floating point exceptions.


I am going through glibc source code.  I found .c files for functions
defined in fenv.h to handle floating point

exceptions but i am not able to figure out how trap is generated.

Thanks

Faisal

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Need details about generating traps for floating point exceptions
  2019-06-24 11:40 Need details about generating traps for floating point exceptions Faisal Riyaz
@ 2019-09-04 19:53 ` Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2019-09-04 19:53 UTC (permalink / raw)
  To: libc-help



On 24/06/2019 08:40, Faisal Riyaz wrote:
> Hi,
> 
> 
> I am interested in knowing more about how traps are generated when floating
> point exception occur.
> 
> Currently, gcc for RISC-V(riscv64-unknown-elf-gcc (GCC) 8.2.0) does not
> generate traps on encountering
> 
> floating point exceptions.
> 
> 
> I am going through glibc source code.  I found .c files for functions
> defined in fenv.h to handle floating point
> 
> exceptions but i am not able to figure out how trap is generated.
> 
> Thanks
> 
> Faisal

Just for the record, as explained in the stackoverflow thread [1], glibc
itself does not *generate* the exceptions itself, although it can *raise*
them if is the case (accordingly to ISA if allows it).

Although it is expected that every port to implement all the functions
defined at fenv.h, each architecture might have different floating-point
semantic and might not fully cover the floating-point standards.  

On internal testing we have some macros each port can override to
enable/disable trap testing (check the sysdeps/generic/math-tests-trap.h). 
On RISC-V, specifically, it states:

sysdeps/riscv/math-tests-trap.h
 23 /* Trapping exceptions are not supported on RISC-V.  */
 24 #define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)      ((EXCEPT) == 0)

[1] https://stackoverflow.com/questions/56746968/how-are-traps-generated-for-floating-point-exceptions

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-04 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 11:40 Need details about generating traps for floating point exceptions Faisal Riyaz
2019-09-04 19:53 ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).