Go to the documentation of this file.
22 #ifndef INCLUDED_GC_SPU_MACS_H
23 #define INCLUDED_GC_SPU_MACS_H
166 #define lr r0 // link register
167 #define sp r1 // stack pointer
170 #define retval r3 // return values are passed in regs starting at r3
172 #define arg1 r3 // args are passed in regs starting at r3
198 #define PROC_ENTRY(name) \
202 .type name, @function; \
212 #define MR(rt, ra) or rt, ra, ra;
215 #define LMR(rt, ra) rotqbyi rt, ra, 0;
218 #define RETURN() bi lr;
221 #define HINT_RETURN(ret_label) hbr ret_label, lr;
224 #define BRZ_RETURN(rt) biz rt, lr;
227 #define BRNZ_RETURN(rt) binz rt, lr;
230 #define BRHZ_RETURN(rt) bihz rt, lr;
233 #define BRHNZ_RETURN(rt) bihnz rt, lr;
243 #define MODULO(rt, ra, pow2) \
244 andi rt, ra, (pow2)-1;
247 #define MODULO_NEG(rt, ra, pow2) \
248 andi rt, ra, (pow2)-1; \
252 #define ROUND_DOWN(rt, ra, pow2) \
253 andi rt, ra, -(pow2);
256 #define ROUND_UP(rt, ra, pow2) \
257 ai rt, ra, (pow2)-1; \
258 andi rt, rt, -(pow2);
268 #define VSPLTB(rt, ra, s) \
269 ilh _gc_t0, (s)*0x0101; \
270 shufb rt, ra, ra, _gc_t0;
273 #define VSPLTH(rt, ra, s) \
274 ilh _gc_t0, 2*(s)*0x0101 + 0x0001; \
275 shufb rt, ra, ra, _gc_t0;
278 #define VSPLTW(rt, ra, s) \
279 iluh _gc_t0, 4*(s)*0x0101 + 0x0001; \
280 iohl _gc_t0, 4*(s)*0x0101 + 0x0203; \
281 shufb rt, ra, ra, _gc_t0;
284 #define VSPLTD(rt, ra, s) \
287 rotqbyi rt, ra, ra, (s) << 3; \
288 shufb rt, rt, rt, _gc_t0;
302 #define MIN_SELB(rt, ra, rb, rc) selb rt, ra, rb, rc;
303 #define MAX_SELB(rt, ra, rb, rc) selb rt, rb, ra, rc;
307 #define MIN(rt, ra, rb) \
308 cgt _gc_t0, ra, rb; \
309 MIN_SELB(rt, ra, rb, _gc_t0)
311 #define MAX(rt, ra, rb) \
312 cgt _gc_t0, ra, rb; \
313 MAX_SELB(rt, ra, rb, _gc_t0)
315 #define UMIN(rt, ra, rb) \
316 clgt _gc_t0, ra, rb; \
317 MIN_SELB(rt, ra, rb, _gc_t0)
319 #define UMAX(rt, ra, rb) \
320 clgt _gc_t0, ra, rb; \
321 MAX_SELB(rt, ra, rb, _gc_t0)
325 #define MINB(rt, ra, rb) \
326 cgtb _gc_t0, ra, rb; \
327 MIN_SELB(rt, ra, rb, _gc_t0)
329 #define MAXB(rt, ra, rb) \
330 cgtb _gc_t0, ra, rb; \
331 MAX_SELB(rt, ra, rb, _gc_t0)
333 #define UMINB(rt, ra, rb) \
334 clgtb _gc_t0, ra, rb; \
335 MIN_SELB(rt, ra, rb, _gc_t0)
337 #define UMAXB(rt, ra, rb) \
338 clgtb _gc_t0, ra, rb; \
339 MAX_SELB(rt, ra, rb, _gc_t0)
343 #define MINH(rt, ra, rb) \
344 cgth _gc_t0, ra, rb; \
345 MIN_SELB(rt, ra, rb, _gc_t0)
347 #define MAXH(rt, ra, rb) \
348 cgth _gc_t0, ra, rb; \
349 MAX_SELB(rt, ra, rb, _gc_t0)
351 #define UMINH(rt, ra, rb) \
352 clgth _gc_t0, ra, rb; \
353 MIN_SELB(rt, ra, rb, _gc_t0)
355 #define UMAXH(rt, ra, rb) \
356 clgth _gc_t0, ra, rb; \
357 MAX_SELB(rt, ra, rb, _gc_t0)
361 #define FMIN(rt, ra, rb) \
362 fcgt _gc_t0, ra, rb; \
363 MIN_SELB(rt, ra, rb, _gc_t0)
365 #define FMAX(rt, ra, rb) \
366 fcgt _gc_t0, ra, rb; \
367 MAX_SELB(rt, ra, rb, _gc_t0)
370 #define FMINMAG(rt, ra, rb) \
371 fcmgt _gc_t0, ra, rb; \
372 MIN_SELB(rt, ra, rb, _gc_t0)
375 #define FMAXMAG(rt, ra, rb) \
376 fcmgt _gc_t0, ra, rb; \
377 MAX_SELB(rt, ra, rb, _gc_t0)