Skip to content

Commit 1408be5

Browse files
authored
Merge pull request #5282 from martin-frbg/zscal_power
kernel/power: Fixed cscal and zscal
2 parents 1589d0b + cf06250 commit 1408be5

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

kernel/power/zscal.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#define X r8
5252
#define INCX r9
5353
#endif
54+
#define FLAG r11
5455
#endif
5556

5657
#if defined(_AIX) || defined(__APPLE__)
@@ -61,6 +62,7 @@
6162
#define X r8
6263
#define INCX r9
6364
#endif
65+
#define FLAG r11
6466
#endif
6567

6668
#define FZERO f0
@@ -94,6 +96,10 @@
9496
fcmpu cr0, FZERO, ALPHA_I
9597
bne- cr0, LL(A1I1)
9698

99+
LDLONG FLAG, 104(SP)
100+
cmpwi cr0, FLAG, 1
101+
beq- cr0, LL(A1I1)
102+
97103
cmpwi cr0, INCX, 2 * SIZE
98104
bne- cr0, LL(A0IN)
99105

kernel/power/zscal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
136136
if ( inc_x <= 0 )
137137
return(0);
138138

139-
if (da_r == ZERO && da_i == ZERO) {
139+
if (da_r == ZERO && da_i == ZERO && dummy2 == 0) {
140140
//clear the vector and return
141141
if (inc_x == 1) {
142142
memset(x, 0, n*COMPSIZE*SIZE);

kernel/power/zscal_ppc440.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#endif
6565

6666
#define INC1 r11
67+
#define FLAG r12
6768

6869
#define FZERO f0
6970
#define ALPHA_R f1
@@ -97,6 +98,10 @@
9798
fcmpu cr0, FZERO, ALPHA_I
9899
bne- cr0, LL(A1I1)
99100

101+
lwz FLAG, FRAMESLOT(0)(SP)
102+
cmpwi cr0, FLAG, 1
103+
beq- cr0, LL(A1I1)
104+
100105
LL(A0IN):
101106
srawi. r0, N, 3
102107
mtspr CTR, r0

0 commit comments

Comments
 (0)