]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
[PowerPC64LE] Fix LE VSX/fpr interop
authorbdragon <bdragon@FreeBSD.org>
Thu, 3 Dec 2020 01:39:59 +0000 (01:39 +0000)
committerbdragon <bdragon@FreeBSD.org>
Thu, 3 Dec 2020 01:39:59 +0000 (01:39 +0000)
commit9fd0688fe806550e186627cebeb57db238305635
tree7cc353eeaaac50317b8286650c5f8a7dd40388c7
parent12b36b24a8a7946c79520b204336fa6196fd2d14
[PowerPC64LE] Fix LE VSX/fpr interop

In the PCB struct, we need to match the VSX register file layout
correctly, as the VSRs shadow the FPRs.

In LE, we need to have a dword of padding before the fprs so they end up
on the correct side, as the struct may be manipulated by either the FP
routines or the VSX routines.

Additionally, when saving and restoring fprs, we need to explicitly target
the fpr union member so it gets offset correctly on LE.

Fixes weirdness with FP registers in VSX-using programs (A FPR that was
saved by the FP routines but restored by the VSX routines was becoming 0
due to being loaded to the wrong side of the VSR.)

Original patch by jhibbits.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D27431
sys/powerpc/include/pcb.h
sys/powerpc/powerpc/fpu.c