|
| From: | Richard Henderson |
| Subject: | Re: [PATCH 1/2] tests/tcg/ppc64le: Added an overflow with OE=1 test |
| Date: | Thu, 18 Aug 2022 08:32:15 -0700 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 8/17/22 09:57, Lucas Mateus Castro(alqotel) wrote:
+void sigfpe_handler(int sig, siginfo_t *si, void *ucontext)
+{
+ uint64_t t;
+ uint64_t ch = 0x5fcfffe4965a17e0ull;
+ asm (
+ "stfd 2, %0\n\t"
+ : "=m"(t)
+ :
+ : "memory", "fr2"
+ );
No, you need to fetch f2 from ucontext. There's no guarantee of any specific values being present in the signal handler otherwise.
+ return -1;
exit(-1), which return from main equates to, helpful over EXIT_FAILURE. But here I'd tend to abort(), since it really shouldn't be reachable. r~
| [Prev in Thread] | Current Thread | [Next in Thread] |