Skip to content

Commit f946a89

Browse files
zscal (case: real alpha=0 ) mikrokernel shift&mem fix , da_i as input reg. small typo fixes
1 parent 2619ad7 commit f946a89

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

kernel/zarch/dswap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void dswap_kernel_32(BLASLONG n, FLOAT *x, FLOAT *y)
139139

140140
#else
141141

142-
static void __attribute__ ((noinline)) dswap_kernel_32(BLASLONG n, FLOAT *x, FLOAT *y)
142+
static void dswap_kernel_32(BLASLONG n, FLOAT *x, FLOAT *y)
143143
{
144144
__asm__ volatile(
145145
"pfd 2, 0(%[ptr_x]) \n\t"
@@ -227,7 +227,7 @@ static void __attribute__ ((noinline)) dswap_kernel_32(BLASLONG n, FLOAT *x, F
227227
[mem_y] "+m" (*(double (*)[n])y),
228228
[n_tmp] "+&r"(n)
229229
: [ptr_x] "a"(x), [ptr_y] "a"(y)
230-
: "cc", "memory","r1", "v0","v1","v2","v3","v4","v5","v6","v7","v16",
230+
: "cc", "r1", "v0","v1","v2","v3","v4","v5","v6","v7","v16",
231231
"v17","v18","v19","v20","v21","v22","v23","v24","v25","v26","v27","v28","v29","v30","v31"
232232
);
233233
return;

kernel/zarch/zscal.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void zscal_kernel_8(BLASLONG n, FLOAT da_r,FLOAT da_i, FLOAT *x) {
9696
"clgrjl %[x_ptr],%%r0,1b \n\t"
9797
: [mem] "+m" (*(double (*)[2*n])x) ,[x_ptr] "+&a"(x)
9898
: [n] "r"(n), [alpha_r] "f"(da_r),[alpha_i] "f"(da_i)
99-
: "cc", "memory","r0","v16","v17","v18","v19","v20","v21","v22","v23","v24","v25"
99+
: "cc", "r0","v16","v17","v18","v19","v20","v21","v22","v23","v24","v25"
100100
);
101101

102102

@@ -106,10 +106,9 @@ static void zscal_kernel_8_zero_r(BLASLONG n, FLOAT da_i, FLOAT *x) {
106106

107107
__asm__ ( "pfd 2, 0(%1) \n\t"
108108
"lgdr %%r0,%[alpha] \n\t"
109-
"vlvgg %%v16,%%r0,0 \n\t"
110-
"lcdbr %[alpha],%[alpha] \n\t"
111-
"lgdr %%r0,%[alpha] \n\t"
112-
"vlvgg %%v16,%%r0,1 \n\t"
109+
"vlvgp %%v16,%%r0,%%r0 \n\t" //load both from disjoint
110+
"vflcdb %%v16,%%v16 \n\t" //complement both
111+
"vlvgg %%v16,%%r0,0 \n\t" //restore 1st
113112
"vlr %%v17 ,%%v16 \n\t"
114113
"sllg %%r0,%[n],4 \n\t"
115114
"agr %%r0,%[x_ptr] \n\t"
@@ -129,8 +128,8 @@ static void zscal_kernel_8_zero_r(BLASLONG n, FLOAT da_i, FLOAT *x) {
129128
"vsteg %%v26, 40(%[x_ptr]),0 \n\t"
130129
"vl %%v27, 48(%[x_ptr]) \n\t"
131130
"vfmdb %%v27,%%v27,%%v17 \n\t"
132-
"vsteg %%v27, 40(%[x_ptr]),1 \n\t"
133-
"vsteg %%v27, 48(%[x_ptr]),0 \n\t"
131+
"vsteg %%v27, 48(%[x_ptr]),1 \n\t"
132+
"vsteg %%v27, 56(%[x_ptr]),0 \n\t"
134133
"vl %%v28, 64(%[x_ptr]) \n\t"
135134
"vfmdb %%v28,%%v28,%%v16 \n\t"
136135
"vsteg %%v28, 64(%[x_ptr]),1 \n\t"
@@ -141,8 +140,8 @@ static void zscal_kernel_8_zero_r(BLASLONG n, FLOAT da_i, FLOAT *x) {
141140
"vsteg %%v29, 88(%[x_ptr]),0 \n\t"
142141
"vl %%v30, 96(%[x_ptr]) \n\t"
143142
"vfmdb %%v30,%%v30,%%v16 \n\t"
144-
"vsteg %%v27, 96(%[x_ptr]),1 \n\t"
145-
"vsteg %%v27, 104(%[x_ptr]),0 \n\t"
143+
"vsteg %%v30, 96(%[x_ptr]),1 \n\t"
144+
"vsteg %%v30, 104(%[x_ptr]),0 \n\t"
146145
"vl %%v31, 112(%[x_ptr]) \n\t"
147146
"vfmdb %%v31,%%v31,%%v17 \n\t"
148147
"vsteg %%v31, 112(%[x_ptr]),1 \n\t"

kernel/zarch/zswap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void zswap_kernel_16(BLASLONG n, FLOAT *x, FLOAT *y)
137137

138138
#else
139139

140-
static void __attribute__ ((noinline)) zswap_kernel_16(BLASLONG n, FLOAT *x, FLOAT *y)
140+
static void zswap_kernel_16(BLASLONG n, FLOAT *x, FLOAT *y)
141141
{
142142
__asm__ volatile(
143143
"pfd 2, 0(%[ptr_x]) \n\t"
@@ -225,7 +225,7 @@ static void __attribute__ ((noinline)) zswap_kernel_16(BLASLONG n, FLOAT *x, F
225225
[mem_y] "+m" (*(double (*)[2*n])y),
226226
[n_tmp] "+&r"(n)
227227
: [ptr_x] "a"(x), [ptr_y] "a"(y)
228-
: "cc", "memory", "r1", "v0","v1","v2","v3","v4","v5","v6","v7","v16",
228+
: "cc", "r1", "v0","v1","v2","v3","v4","v5","v6","v7","v16",
229229
"v17","v18","v19","v20","v21","v22","v23","v24","v25","v26","v27","v28","v29","v30","v31"
230230
);
231231
return;

0 commit comments

Comments
 (0)