Skip to content

Commit

Permalink
Merge pull request #2312 from martin-frbg/power8be
Browse files Browse the repository at this point in the history
Further Power8 big-endian corrections
  • Loading branch information
martin-frbg authored Nov 20, 2019
2 parents 63d3ee8 + cad0d15 commit 08fa83a
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 11 deletions.
20 changes: 20 additions & 0 deletions kernel/power/KERNEL.POWER8
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,30 @@ ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#SMINKERNEL = ../arm/min.c
#DMINKERNEL = ../arm/min.c
#
ifneq ($(__BYTE_ORDER__),$(__ORDER_BIG_ENDIAN__))
ISAMAXKERNEL = isamax_power8.S
else
ISAMAXKERNEL = isamax.c
endif
IDAMAXKERNEL = idamax.c
ifneq ($(__BYTE_ORDER__),$(__ORDER_BIG_ENDIAN__))
ICAMAXKERNEL = icamax_power8.S
else
ICAMAXKERNEL = icamax.c
endif
IZAMAXKERNEL = izamax.c
#
ifneq ($(__BYTE_ORDER__),$(__ORDER_BIG_ENDIAN__))
ISAMINKERNEL = isamin_power8.S
else
ISAMINKERNEL = isamin.c
endif
IDAMINKERNEL = idamin.c
ifneq ($(__BYTE_ORDER__),$(__ORDER_BIG_ENDIAN__))
ICAMINKERNEL = icamin_power8.S
else
ICAMINKERNEL = icamin.c
endif
IZAMINKERNEL = izamin.c
#
#ISMAXKERNEL = ../arm/imax.c
Expand All @@ -112,7 +128,11 @@ ZASUMKERNEL = zasum.c
#
SAXPYKERNEL = saxpy.c
DAXPYKERNEL = daxpy.c
ifneq ($(__BYTE_ORDER__),$(__ORDER_BIG_ENDIAN__))
CAXPYKERNEL = caxpy_power8.S
else
CAXPYKERNEL = caxpy.c
endif
ZAXPYKERNEL = zaxpy.c
#
SCOPYKERNEL = scopy.c
Expand Down
5 changes: 4 additions & 1 deletion kernel/power/caxpy_power8.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

PROLOGUE

caxpy_k:
.LCF0:
0: addis 2,12,.TOC.-.LCF0@ha
addi 2,2,.TOC.-.LCF0@l
#if _CALL_ELF ==2
.localentry caxpy_k,.-caxpy_k
#endif
mr. 7,3
ble 0,.L33
cmpdi 7,9,1
Expand Down Expand Up @@ -515,7 +516,9 @@ caxpy_k:
b .L13
.long 0
.byte 0,0,0,0,0,4,0,0
#if _CALL_ELF ==2
.size caxpy_k,.-caxpy_k
#endif
.section .rodata
.align 4
.set .LANCHOR0,. + 0
Expand Down
5 changes: 4 additions & 1 deletion kernel/power/icamin_power8.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

PROLOGUE

icamin_k:
.LCF0:
0: addis 2,12,.TOC.-.LCF0@ha
addi 2,2,.TOC.-.LCF0@l
#if _CALL_ELF ==2
.localentry icamin_k,.-icamin_k
#endif
mr. 9,3
ble 0,.L25
cmpdi 7,5,0
Expand Down Expand Up @@ -388,7 +389,9 @@ icamin_k:
b .L21
.long 0
.byte 0,0,0,0,0,1,0,0
#if _CALL_ELF ==2
.size icamin_k,.-icamin_k
#endif
.section .rodata.cst16,"aM",@progbits,16
.align 4
.LC2:
Expand Down
6 changes: 3 additions & 3 deletions kernel/power/idamax.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,15 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) {

if (inc_x == 1) {

#if defined(_CALL_ELF) && (_CALL_ELF == 2)
BLASLONG n1 = n & -32;
if (n1 > 0) {
#if defined(_CALL_ELF) && (_CALL_ELF == 2)
if (n1 > 0) {

max = diamax_kernel_32(n1, x, &maxf);

i = n1;
}
#endif
#endif
while (i < n) {
if (ABS(x[i]) > maxf) {
max = i;
Expand Down
3 changes: 1 addition & 2 deletions kernel/power/idamin.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,12 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) {

#if defined(_CALL_ELF) && (_CALL_ELF == 2)
BLASLONG n1 = n & -32;
if (n1 > 0) {
if (n1 > 0) {

min = diamin_kernel_32(n1, x, &minf);
i = n1;
}
#endif

while (i < n) {
if (ABS(x[i]) < minf) {
min = i;
Expand Down
5 changes: 4 additions & 1 deletion kernel/power/isamax_power8.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

PROLOGUE

isamax_k:
.LCF0:
0: addis 2,12,.TOC.-.LCF0@ha
addi 2,2,.TOC.-.LCF0@l
#if _CALL_ELF ==2
.localentry isamax_k,.-isamax_k
#endif
mr. 11,3
ble 0,.L36
cmpdi 7,5,0
Expand Down Expand Up @@ -397,7 +398,9 @@ isamax_k:
b .L61
.long 0
.byte 0,0,0,0,0,1,0,0
#if _CALL_ELF ==2
.size isamax_k,.-isamax_k
#endif
.section .rodata.cst16,"aM",@progbits,16
.align 4
.LC2:
Expand Down
5 changes: 4 additions & 1 deletion kernel/power/isamin_power8.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

PROLOGUE

isamin_k:
.LCF0:
0: addis 2,12,.TOC.-.LCF0@ha
addi 2,2,.TOC.-.LCF0@l
#if _CALL_ELF ==2
.localentry isamin_k,.-isamin_k
#endif
mr. 11,3
ble 0,.L36
cmpdi 7,5,0
Expand Down Expand Up @@ -380,7 +381,9 @@ isamin_k:
b .L35
.long 0
.byte 0,0,0,0,0,1,0,0
#if _CALL_ELF ==2
.size isamin_k,.-isamin_k
#endif
.section .rodata.cst16,"aM",@progbits,16
.align 4
.LC2:
Expand Down
4 changes: 2 additions & 2 deletions kernel/power/izamin.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
minf = CABS1(x,0); //index will not be incremented

#if defined(_CALL_ELF) && (_CALL_ELF == 2)
BLASLONG n1 = n & -16;
BLASLONG n1 = n & -16;
if (n1 > 0) {

min = ziamin_kernel_16_TUNED(n1, x, &minf);
i = n1;
ix = n1 << 1;
}
#endif
#endif

while(i < n)
{
Expand Down

0 comments on commit 08fa83a

Please sign in to comment.