Debian #943425: [s390x] setjmp/longjmp do not save/restore all registers in use (was Use of $v10 register (was Re: klibc: [s390x] SIGSEGV in mksh testcase funsub-2))

Thorsten Glaser <[email protected]>
Newsgroups gmane.linux.debian.ports.s390
Message-ID <[email protected]>
Dixi quod…

>So, setjmp/longjmp in klibc save f1/f3/f5/f7 (as shown on Wikipedia
>https://en.wikipedia.org/wiki/Calling_convention#IBM_System/360_and_successors
>“the z/Architecture ABI,[11] used in Linux” a page down), while
>glibc’s save f8–f15 instead.

Jessica Clarke brought out docs saying f8‥f15 must be saved, the
other FPU registers not:
https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html#AEN413

This matches what glibc does. Maybe an s390x porter wishes to fix
Wikipedia?

>https://share.confex.com/share/124/webprogram/Handout/Session16897/SHARE_Seattle_2015_SIMD.pdf
>shows that the vector registers overlap and extend the FPU registers.

>• is register v10 (vector extension) even supposed to be used?

This needs to be answered, I guess, because…

>• klibc does not really support the FPU anyway

… GCC chooses to allocate an FPU register for a pointer value.

>• the half of v10 that equals f10 just HAPPENS to be saved by
>  glibc, but what if the upper half, that is outside of the FPU,
>  is used?

The question here is, does GCC only use the halves of the half
of the vector registers that match the FPU registers?

@klibc list: as indicated earlier, I can provide a patch if needed
(though it should be obvious).

bye,
//mirabilos
-- 
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.