Skip to content

Commit 4e83f24

Browse files
dijopaulcad-audio
andauthored
Patch for div_mod build issue on Xtensa (#6814)
* Adding mean and where ops optimized on HiFi * Fix for build issue faced in div_mod on old tools --------- Co-authored-by: cad-audio <[email protected]>
1 parent f32cffd commit 4e83f24

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

backends/cadence/hifi/third-party/nnlib/xa_nn_elm_div_mode_f32_broadcast.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ WORD32 xa_nn_elm_div_mode_f32xf32_f32(FLOAT32 * __restrict__ p_out,
5454
XT_LASX2IP(x1, inp1_a, inp1);
5555
XT_LASX2IP(x2, inp2_a, inp2);
5656
y = XT_DIV_SX2(x1, x2);
57-
y = FITRUNC_SX2(y);
57+
y = XT_FITRUNC_SX2(y);
5858
XT_SASX2IP(y, out_a, out);
5959
}
6060
}
@@ -66,7 +66,7 @@ WORD32 xa_nn_elm_div_mode_f32xf32_f32(FLOAT32 * __restrict__ p_out,
6666
XT_LASX2IP(x1, inp1_a, inp1);
6767
XT_LASX2IP(x2, inp2_a, inp2);
6868
y = XT_DIV_SX2(x1, x2);
69-
y = FIFLOOR_SX2(y);
69+
y = XT_FIFLOOR_SX2(y);
7070
XT_SASX2IP(y, out_a, out);
7171
}
7272
}
@@ -80,9 +80,9 @@ WORD32 xa_nn_elm_div_mode_f32xf32_f32(FLOAT32 * __restrict__ p_out,
8080
XT_LSIP(a2, (xtfloat *)inp2, 0);
8181
a = XT_DIV_S(a1, a2);
8282
if(mode == 0)
83-
a = FITRUNC_S(a);
83+
a = XT_FITRUNC_S(a);
8484
else
85-
a = FIFLOOR_S(a);
85+
a = XT_FIFLOOR_S(a);
8686
XT_SSI(a, (xtfloat *)out, 0);
8787
}
8888

@@ -138,7 +138,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
138138
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
139139
XT_LSX2IP(x2, p_b, 2 * sizeof(FLOAT32));
140140
y = XT_DIV_SX2(x2, x1);
141-
y = FITRUNC_SX2(y);
141+
y = XT_FITRUNC_SX2(y);
142142
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
143143
}
144144
}
@@ -149,7 +149,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
149149
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
150150
XT_LSX2IP(x2, p_b, 2 * sizeof(FLOAT32));
151151
y = XT_DIV_SX2(x2, x1);
152-
y = FIFLOOR_SX2(y);
152+
y = XT_FIFLOOR_SX2(y);
153153
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
154154
}
155155
}
@@ -166,7 +166,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
166166
XT_LASX2IP(x1, vinp1, p_a);
167167
XT_LASX2IP(x2, vinp2, p_b);
168168
y = XT_DIV_SX2(x2, x1);
169-
y = FITRUNC_SX2(y);
169+
y = XT_FITRUNC_SX2(y);
170170
XT_SASX2IP(y, out_a, p_c);
171171
}
172172
}
@@ -177,7 +177,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
177177
XT_LASX2IP(x1, vinp1, p_a);
178178
XT_LASX2IP(x2, vinp2, p_b);
179179
y = XT_DIV_SX2(x2, x1);
180-
y = FIFLOOR_SX2(y);
180+
y = XT_FIFLOOR_SX2(y);
181181
XT_SASX2IP(y, out_a, p_c);
182182
}
183183
}
@@ -189,9 +189,9 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
189189
XT_LSIP(b0, (xtfloat *)p_b, sizeof(FLOAT32));
190190
c0 = XT_DIV_S(b0, a0);
191191
if(mode == 0)
192-
c0 = FITRUNC_S(c0);
192+
c0 = XT_FITRUNC_S(c0);
193193
else
194-
c0 = FIFLOOR_S(c0);
194+
c0 = XT_FIFLOOR_S(c0);
195195
XT_SSI(c0, (xtfloat *)p_c, 0);
196196
}
197197
}
@@ -213,7 +213,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
213213
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
214214
XT_LSX2IP(x2, p_b, 2 * sizeof(FLOAT32));
215215
y = XT_DIV_SX2(x1, x2);
216-
y = FITRUNC_SX2(y);
216+
y = XT_FITRUNC_SX2(y);
217217
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
218218
}
219219
}
@@ -224,7 +224,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
224224
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
225225
XT_LSX2IP(x2, p_b, 2 * sizeof(FLOAT32));
226226
y = XT_DIV_SX2(x1, x2);
227-
y = FIFLOOR_SX2(y);
227+
y = XT_FIFLOOR_SX2(y);
228228
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
229229
}
230230
}
@@ -241,7 +241,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
241241
XT_LASX2IP(x1, vinp1, p_a);
242242
XT_LASX2IP(x2, vinp2, p_b);
243243
y = XT_DIV_SX2(x1, x2);
244-
y = FITRUNC_SX2(y);
244+
y = XT_FITRUNC_SX2(y);
245245
XT_SASX2IP(y, out_a, p_c);
246246
}
247247
}
@@ -252,7 +252,7 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
252252
XT_LASX2IP(x1, vinp1, p_a);
253253
XT_LASX2IP(x2, vinp2, p_b);
254254
y = XT_DIV_SX2(x1, x2);
255-
y = FIFLOOR_SX2(y);
255+
y = XT_FIFLOOR_SX2(y);
256256
XT_SASX2IP(y, out_a, p_c);
257257
}
258258
}
@@ -264,9 +264,9 @@ static void internal_elm_div_mode_broadcast_2D_f32xf32_f32(FLOAT32 * __restrict_
264264
XT_LSIP(b0, (xtfloat *)p_b, sizeof(FLOAT32));
265265
c0 = XT_DIV_S(a0, b0);
266266
if(mode == 0)
267-
c0 = FITRUNC_S(c0);
267+
c0 = XT_FITRUNC_S(c0);
268268
else
269-
c0 = FIFLOOR_S(c0);
269+
c0 = XT_FIFLOOR_S(c0);
270270
XT_SSI(c0, (xtfloat *)p_c, 0);
271271
}
272272
}
@@ -302,7 +302,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
302302
{
303303
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
304304
y = XT_DIV_SX2(x2, x1);
305-
y = FITRUNC_SX2(y);
305+
y = XT_FITRUNC_SX2(y);
306306
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
307307
}
308308
}
@@ -312,7 +312,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
312312
{
313313
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
314314
y = XT_DIV_SX2(x2, x1);
315-
y = FIFLOOR_SX2(y);
315+
y = XT_FIFLOOR_SX2(y);
316316
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
317317
}
318318
}
@@ -328,7 +328,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
328328
{
329329
XT_LASX2IP(x1, inp1_a, p_a);
330330
y = XT_DIV_SX2(x2, x1);
331-
y = FITRUNC_SX2(y);
331+
y = XT_FITRUNC_SX2(y);
332332
XT_SASX2IP(y, out_a, p_c);
333333
}
334334
}
@@ -338,7 +338,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
338338
{
339339
XT_LASX2IP(x1, inp1_a, p_a);
340340
y = XT_DIV_SX2(x2, x1);
341-
y = FIFLOOR_SX2(y);
341+
y = XT_FIFLOOR_SX2(y);
342342
XT_SASX2IP(y, out_a, p_c);
343343
}
344344
}
@@ -349,9 +349,9 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
349349
XT_LSIP(a0_7, (xtfloat *)p_a, sizeof(FLOAT32));
350350
out = XT_DIV_S(x2, a0_7);
351351
if(mode == 0)
352-
out = FITRUNC_S(out);
352+
out = XT_FITRUNC_S(out);
353353
else
354-
out = FIFLOOR_S(out);
354+
out = XT_FIFLOOR_S(out);
355355
XT_SSI(out, (xtfloat *)p_c, 0);
356356
}
357357
}
@@ -366,7 +366,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
366366
{
367367
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
368368
y = XT_DIV_SX2(x1, x2);
369-
y = FITRUNC_SX2(y);
369+
y = XT_FITRUNC_SX2(y);
370370
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
371371
}
372372
}
@@ -376,7 +376,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
376376
{
377377
XT_LSX2IP(x1, p_a, 2 * sizeof(FLOAT32));
378378
y = XT_DIV_SX2(x1, x2);
379-
y = FIFLOOR_SX2(y);
379+
y = XT_FIFLOOR_SX2(y);
380380
XT_SSX2IP(y, p_c, 2 * sizeof(FLOAT32));
381381
}
382382
}
@@ -392,7 +392,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
392392
{
393393
XT_LASX2IP(x1, inp1_a, p_a);
394394
y = XT_DIV_SX2(x1, x2);
395-
y = FITRUNC_SX2(y);
395+
y = XT_FITRUNC_SX2(y);
396396
XT_SASX2IP(y, out_a, p_c);
397397
}
398398
}
@@ -402,7 +402,7 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
402402
{
403403
XT_LASX2IP(x1, inp1_a, p_a);
404404
y = XT_DIV_SX2(x1, x2);
405-
y = FIFLOOR_SX2(y);
405+
y = XT_FIFLOOR_SX2(y);
406406
XT_SASX2IP(y, out_a, p_c);
407407
}
408408
}
@@ -413,9 +413,9 @@ static void internal_elm_div_mode_broadcast_f32xf32_f32(FLOAT32 * __restrict__ p
413413
XT_LSIP(a0_7, (xtfloat *)p_a, sizeof(FLOAT32));
414414
out = XT_DIV_S(a0_7, x2);
415415
if(mode == 0)
416-
out = FITRUNC_S(out);
416+
out = XT_FITRUNC_S(out);
417417
else
418-
out = FIFLOOR_S(out);
418+
out = XT_FIFLOOR_S(out);
419419
XT_SSI(out, (xtfloat *)p_c, 0);
420420
}
421421
}

0 commit comments

Comments
 (0)