Power8 inline assembly fixes
Quoting patch author amodra from #1078 Lots of issues here. - The vsx regs weren't listed as clobbered. - Poor choice of vsx regs, which along with the lack of clobbers led to trashing v0..v21 and fr14..fr23. Ideally you'd let gcc choose all temp vsx regs, but asms currently have a limit of 30 i/o parms. - Other regs were clobbered unnecessarily, seemingly in an attempt to clobber inputs, with gcc-7 complaining about the clobber of r2. (Changed inputs should be also listed as outputs or as an i/o.) - "r" constraint used instead of "b" for gprs used in insns where the r0 encoding means zero rather than r0. - There were unused asm inputs too. - All memory was clobbered rather than hooking up memory outputs with proper memory constraints, and that and the lack of proper memory input constraints meant the asms needed to be volatile and their containing function noinline. - Some parameters were being passed unnecessarily via memory. - When a copy of a
This commit is contained in:
@@ -53,7 +53,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef HAVE_KERNEL_16
|
||||
|
||||
static void casum_kernel_16(BLASLONG n, FLOAT *x1, FLOAT *svec)
|
||||
static FLOAT casum_kernel_16(BLASLONG n, FLOAT *x1)
|
||||
{
|
||||
|
||||
BLASLONG i=0;
|
||||
@@ -92,11 +92,7 @@ static void casum_kernel_16(BLASLONG n, FLOAT *x1, FLOAT *svec)
|
||||
|
||||
}
|
||||
|
||||
svec[0] = sum0+sum1+sum2+sum3;
|
||||
svec[1] = 0.0;
|
||||
svec[2] = 0.0;
|
||||
svec[3] = 0.0;
|
||||
|
||||
return sum0+sum1+sum2+sum3;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -106,7 +102,6 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
|
||||
BLASLONG i=0;
|
||||
BLASLONG ip=0;
|
||||
FLOAT sumf = 0.0;
|
||||
FLOAT svec[4] __attribute__ ((aligned (16)));;
|
||||
BLASLONG n1;
|
||||
BLASLONG inc_x2;
|
||||
|
||||
@@ -119,8 +114,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
|
||||
if ( n1 > 0 )
|
||||
{
|
||||
|
||||
casum_kernel_16(n1, x, svec);
|
||||
sumf = svec[0] + svec[1]+svec[2]+svec[3];
|
||||
sumf = casum_kernel_16(n1, x);
|
||||
i=n1;
|
||||
ip = 2 * n1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user