Skip to content

Commit 46e415b

Browse files
authored
Save and restore input argument 8 (lda4)
Fixes miscompilation with gcc9 -ftree-vectorize (related to issue #2009)
1 parent 69edc5b commit 46e415b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kernel/x86_64/sgemv_n_microk_haswell-4.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
*****************************************************************************/
2727

2828

29-
3029
#define HAVE_KERNEL_4x8 1
3130
static void sgemv_kernel_4x8( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, BLASLONG lda4, FLOAT *alpha) __attribute__ ((noinline));
3231

@@ -49,6 +48,8 @@ static void sgemv_kernel_4x8( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, BLASLO
4948

5049
"vbroadcastss (%9), %%ymm6 \n\t" // alpha
5150

51+
"movq %8, %%xmm10 \n\t" //save lda
52+
5253
"testq $0x04, %1 \n\t"
5354
"jz 2f \n\t"
5455

@@ -151,6 +152,7 @@ static void sgemv_kernel_4x8( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, BLASLO
151152

152153
"4: \n\t"
153154
"vzeroupper \n\t"
155+
"movq %%xmm10, %8 \n\t" //restore lda
154156

155157
:
156158
"+r" (i), // 0
@@ -170,14 +172,14 @@ static void sgemv_kernel_4x8( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, BLASLO
170172
"%xmm4", "%xmm5",
171173
"%xmm6", "%xmm7",
172174
"%xmm8", "%xmm9",
175+
"%xmm10",
173176
"%xmm12", "%xmm13", "%xmm14", "%xmm15",
174177
"memory"
175178
);
176179

177180
}
178181

179182

180-
181183
#define HAVE_KERNEL_4x4 1
182184
static void sgemv_kernel_4x4( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, FLOAT *alpha) __attribute__ ((noinline));
183185

@@ -196,6 +198,7 @@ static void sgemv_kernel_4x4( BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, FLOAT
196198

197199
"vbroadcastss (%8), %%ymm6 \n\t" // alpha
198200

201+
199202
"testq $0x04, %1 \n\t"
200203
"jz 2f \n\t"
201204

0 commit comments

Comments
 (0)