@@ -36,6 +36,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
36
#define PTR_ST st.d
37
37
#define PTR_SLLI slli.d
38
38
#define PTR_SRLI srli.d
39
+ #define PTR_SRAI srai.d
40
+ #define PTR_MUL mul .d
39
41
#define PTR_ALSL alsl.d
40
42
#else
41
43
#define LA_REG int32_t
@@ -48,6 +50,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48
50
#define PTR_ST st.w
49
51
#define PTR_SLLI slli.w
50
52
#define PTR_SRLI srli.w
53
+ #define PTR_SRAI srai.w
54
+ #define PTR_MUL mul .w
51
55
#define PTR_ALSL alsl.w
52
56
#endif
53
57
@@ -218,6 +222,15 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
218
222
.endif
219
223
.endm
220
224
//
225
+ // GSUB
226
+ //
227
+ .macro GSUB pre_op , suf_op:req , out :req , in0:req , in1:req , more:vararg
228
+ \pre_op\() sub .\suf_op \ out , \in0 , \in1
229
+ .ifnb \more
230
+ GSUB \pre_op , \suf_op , \more
231
+ .endif
232
+ .endm
233
+ //
221
234
// GSLLI
222
235
//
223
236
.macro GSLLI pre_op , suf_op:req , out :req , in0:req , in1:req , more:vararg
@@ -244,6 +257,33 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
244
257
GXOR \pre_op , \suf_op , \more
245
258
.endif
246
259
.endm
260
+ //
261
+ // GPERMI
262
+ //
263
+ .macro GPERMI pre_op:req , suf_op:req , out :req , in0:req , in1:req , more:vararg
264
+ \pre_op\()permi.\suf_op \ out , \in0 , \in1
265
+ .ifnb \more
266
+ GPERMI \pre_op , \suf_op , \more
267
+ .endif
268
+ .endm
269
+ //
270
+ // GNMSUB
271
+ //
272
+ .macro GNMSUB pre_op:req , suf_op:req , out :req , in0:req , in1:req , in2:req , more:vararg
273
+ \pre_op\()nmsub.\suf_op \ out , \in0 , \in1 , \in2
274
+ .ifnb \more
275
+ GNMSUB \pre_op , \suf_op , \more
276
+ .endif
277
+ .endm
278
+ //
279
+ // GPRELD
280
+ //
281
+ .macro GPRELD in0:req , in1:req , in2:req , more:vararg
282
+ preld \in0 , \in1 , \in2
283
+ .ifnb \more
284
+ GPRELD \more
285
+ .endif
286
+ .endm
247
287
248
288
//
249
289
// Compound instructions
@@ -311,3 +351,57 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311
351
GACC \pre_op , \suf_op , \more
312
352
.endif
313
353
.endm
354
+ //
355
+ // GMOV
356
+ //
357
+ .macro GMOV pre_op:req , out :req , in :req , more:vararg
358
+ \pre_op\() or .v \ out , \ in , \ in
359
+ .ifnb \more
360
+ GMOV \pre_op , \more
361
+ .endif
362
+ .endm
363
+
364
+ //
365
+ // Media Related Macros
366
+ //
367
+ .macro GSBUTTERFLY pre_op , suf_op , out0 , out1 , in0 , in1
368
+ \pre_op\()ilvl.\suf_op \out0 , \in0 , \in1
369
+ \pre_op\()ilvh.\suf_op \out1 , \in0 , \in1
370
+ .endm
371
+ .macro GINTERLACE pre_op , suf_op , out0 , out1 , in0 , in1
372
+ \pre_op\()pickev.\suf_op \out0 , \in0 , \in1
373
+ \pre_op\()pickod.\suf_op \out1 , \in0 , \in1
374
+ .endm
375
+
376
+ //
377
+ // TRANSPOSE4x4_D: Transpose 4x4 block with double - word elements in vectors ,
378
+ // has no pre_op param. 128 - bit vector instructions are not supported.
379
+ //
380
+ .macro GTRANSPOSE4x4_D in0 , in1 , in2 , in3 , out0 , out1 , out2 , out3 , \
381
+ vt0 , vt1
382
+ GSBUTTERFLY xv , d , \vt0 , \out1 , \in1 , \in0
383
+ GSBUTTERFLY xv , d , \vt1 , \out3 , \in3 , \in2
384
+ GMOV xv , \out0 , \vt0 , \out2 , \vt1 , \vt1 , \out3
385
+ GPERMI xv , q , \out0 , \out2 , 0x02 , \out2 , \vt0 , 0x31 , \out3 , \out1 , 0x31 , \out1 , \vt1 , 0x02
386
+ .endm
387
+
388
+ .macro GTRANSPOSE8x8_W out0 , out1 , out2 , out3 , out4 , out5 , out6 , out7 , \
389
+ in0 , in1 , in2 , in3 , in4 , in5 , in6 , in7 , \
390
+ tmp0 , tmp1 , tmp2 , tmp3
391
+ GSBUTTERFLY xv , w , \tmp0 , \tmp2 , \in2 , \in0
392
+ GSBUTTERFLY xv , w , \tmp1 , \tmp3 , \in3 , \in1
393
+ GSBUTTERFLY xv , w , \out0 , \out1 , \tmp1 , \tmp0
394
+ GSBUTTERFLY xv , w , \out2 , \out3 , \tmp3 , \tmp2
395
+
396
+ GSBUTTERFLY xv , w , \tmp0 , \tmp2 , \in6 , \in4
397
+ GSBUTTERFLY xv , w , \tmp1 , \tmp3 , \in7 , \in5
398
+ GSBUTTERFLY xv , w , \out4 , \out5 , \tmp1 , \tmp0
399
+ GSBUTTERFLY xv , w , \out6 , \out7 , \tmp3 , \tmp2
400
+
401
+ GMOV xv , \tmp0 , \out0 , \tmp1 , \out1 , \tmp2 , \out2 , \tmp3 , \out3
402
+
403
+ GPERMI xv , q , \out0 , \out4 , 0x02 , \out1 , \out5 , 0x02 , \
404
+ \out2 , \out6 , 0x02 , \out3 , \out7 , 0x02 , \
405
+ \out4 , \tmp0 , 0x31 , \out5 , \tmp1 , 0x31 , \
406
+ \out6 , \tmp2 , 0x31 , \out7 , \tmp3 , 0x31
407
+ .endm
0 commit comments