Skip to content

Commit c2ffd90

Browse files
authored
make NAN handling depend on dummy2 parameter
1 parent dd6c33d commit c2ffd90

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

kernel/x86_64/scal_sse.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@
6060
#ifdef WINDOWS_ABI
6161
movq 40(%rsp), X
6262
movq 48(%rsp), INCX
63-
63+
movq 64(%rsp), %r9
6464
movaps %xmm3, %xmm0
65+
#else
66+
movq 24(%rsp), %r9
6567
#endif
6668

6769
SAVEREGISTERS
@@ -76,6 +78,8 @@
7678
shufps $0, %xmm0, %xmm0
7779

7880
jne .L100 # Alpha != ZERO
81+
82+
cmpq $1, %r9
7983
je .L100
8084
/* Alpha == ZERO */
8185
cmpq $SIZE, INCX

kernel/x86_64/scal_sse2.S

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define X ARG2
4949
#define INCX ARG3
5050
#endif
51+
#define FLAG %r9
5152

5253
#define XX %r10
5354
#define I %rax
@@ -60,8 +61,10 @@
6061
#ifdef WINDOWS_ABI
6162
movq 40(%rsp), X
6263
movq 48(%rsp), INCX
63-
64+
movq 64(%rsp), FLAG
6465
movaps %xmm3, %xmm0
66+
#else
67+
movq 24(%rsp), FLAG
6568
#endif
6669

6770
SAVEREGISTERS
@@ -75,6 +78,8 @@
7578
comisd %xmm0, %xmm1
7679
jne .L100 # Alpha != ZERO
7780
jp .L100 # For Alpha = NaN
81+
82+
cmpq $1, FLAG
7883
je .L100 # disable the Alpha=zero path as it does not handle x=inf or nan
7984
/* Alpha == ZERO */
8085
cmpq $SIZE, INCX

0 commit comments

Comments
 (0)