Skip to content

Commit 0b08f74

Browse files
committed
Refs #154. Fixed gemv_t bug about overflow 16MB buffer on x86.
1 parent 200e4ac commit 0b08f74

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

kernel/x86/gemv_t_sse.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@
142142
.L0t:
143143
xorl J,J
144144
addl $1,J
145-
sall $21,J # J=2^22
145+
sall $22,J # J=2^24*sizeof(float)=buffer size(16MB)
146+
subl $8, J # Don't use last 8 float in the buffer.
147+
# Now, split M by block J
146148
subl J,MMM # MMM=MMM-J
147149
movl J,M
148150
jge .L00t

kernel/x86/gemv_t_sse2.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@
128128
.L0t:
129129
xorl J,J
130130
addl $1,J
131-
sall $22,J # J=2^22
131+
sall $21,J # J=2^21*sizeof(double)=buffer size(16MB)
132+
subl $4, J # Don't use last 4 double in the buffer.
133+
# Now, split M by block J
132134
subl J,MMM # MMM=MMM-J
133135
movl J,M
134136
jge .L00t

0 commit comments

Comments
 (0)