gonum / internal

Internal routines for the gonum project [DEPRECATED]
21 stars 9 forks source link

asm/f64: Alignment bug in DivTo fixed with test added. #45

Closed Kunde21 closed 7 years ago

Kunde21 commented 7 years ago

DIVPD using memory requires 16-byte alignment. Alignment block was testing against dst slice instead of y slice.

kortschak commented 7 years ago

Also, are we depending on compiler implementation for these misaligned slices? If we are we should probably at some point make something that will return a slice with arbitrary alignment.

Kunde21 commented 7 years ago

Yes and no. We are relying on compiler alignment, but it's because the architecture requires 8-bit alignment for 64-bit types. Thus, all we need to do here is trim 8-bit alignment to create 16-bit alignment, for SSE requirements.

kortschak commented 7 years ago

Sorry, I meant with the test values - in order to generate arbitrary bad alignments.

Kunde21 commented 7 years ago

Yes, line 473 and 539 set alignment by changing the guard lengths. We might be better off to code them into the test struct to mis-align the tests we want, though.

kortschak commented 7 years ago

I did not realise you were not a member. I've sent an invitation.