FFmpeg
Macros
mmiutils.h File Reference
#include "config.h"
#include "libavutil/mem_internal.h"
#include "libavutil/mips/asmdefs.h"

Go to the source code of this file.

Macros

#define DECLARE_VAR_LOW32
 
#define RESTRICT_ASM_LOW32
 
#define DECLARE_VAR_ALL64
 
#define RESTRICT_ASM_ALL64
 
#define DECLARE_VAR_ADDRT
 
#define RESTRICT_ASM_ADDRT
 
#define BACKUP_REG
 Backup saved registers We're not using compiler's clobber list as it's not smart enough to take advantage of quad word load/store. More...
 
#define RECOVER_REG
 recover register More...
 
#define TRANSPOSE_2W(fr_i0, fr_i1, fr_o0, fr_o1)
 brief: Transpose 2X2 word packaged data. More...
 
#define TRANSPOSE_4H(fr_i0, fr_i1, fr_i2, fr_i3, fr_t0, fr_t1, fr_t2, fr_t3)
 brief: Transpose 4X4 half word packaged data. More...
 
#define TRANSPOSE_8B(fr_i0, fr_i1, fr_i2, fr_i3, fr_i4, fr_i5, fr_i6, fr_i7, fr_t0, fr_t1, fr_t2, fr_t3)
 brief: Transpose 8x8 byte packaged data. More...
 
#define PSRAB_MMI(fr_i0, fr_i1, fr_t0, fr_t1, fr_d0)
 brief: Parallel SRA for 8 byte packaged data. More...
 
#define PSRLB_MMI(fr_i0, fr_i1, fr_t0, fr_t1, fr_d0)
 brief: Parallel SRL for 8 byte packaged data. More...
 
#define PSRAH_4_MMI(fp1, fp2, fp3, fp4, shift)
 
#define PSRAH_8_MMI(fp1, fp2, fp3, fp4, fp5, fp6, fp7, fp8, shift)
 
#define ROUND_POWER_OF_TWO_MMI(fr_i0, fr_i1, fr_t0, fr_t1, gr_t0)
 brief: (((value) + (1 << ((n) - 1))) >> (n)) fr_i0: src & dst fr_i1: Operand number fr_t0, fr_t1: temporary FPR gr_t0: temporary GPR More...
 

Macro Definition Documentation

◆ DECLARE_VAR_LOW32

#define DECLARE_VAR_LOW32

Definition at line 37 of file mmiutils.h.

◆ RESTRICT_ASM_LOW32

#define RESTRICT_ASM_LOW32

Definition at line 38 of file mmiutils.h.

◆ DECLARE_VAR_ALL64

#define DECLARE_VAR_ALL64

Definition at line 39 of file mmiutils.h.

◆ RESTRICT_ASM_ALL64

#define RESTRICT_ASM_ALL64

Definition at line 40 of file mmiutils.h.

◆ DECLARE_VAR_ADDRT

#define DECLARE_VAR_ADDRT

Definition at line 41 of file mmiutils.h.

◆ RESTRICT_ASM_ADDRT

#define RESTRICT_ASM_ADDRT

Definition at line 42 of file mmiutils.h.

◆ BACKUP_REG

#define BACKUP_REG
Value:
LOCAL_ALIGNED_16(double, temp_backup_reg, [8]); \
if (_MIPS_SIM == _ABI64) \
__asm__ volatile ( \
MMI_SQC1($f25, $f24, %[temp], 0x00) \
MMI_SQC1($f27, $f26, %[temp], 0x10) \
MMI_SQC1($f29, $f28, %[temp], 0x20) \
MMI_SQC1($f31, $f30, %[temp], 0x30) \
: \
: [temp]"r"(temp_backup_reg) \
: "memory" \
); \
else \
__asm__ volatile ( \
MMI_SQC1($f22, $f20, %[temp], 0x10) \
MMI_SQC1($f26, $f24, %[temp], 0x10) \
MMI_SQC1($f30, $f28, %[temp], 0x20) \
: \
: [temp]"r"(temp_backup_reg) \
: "memory" \
);

Backup saved registers We're not using compiler's clobber list as it's not smart enough to take advantage of quad word load/store.

Definition at line 235 of file mmiutils.h.

◆ RECOVER_REG

#define RECOVER_REG
Value:
if (_MIPS_SIM == _ABI64) \
__asm__ volatile ( \
MMI_LQC1($f25, $f24, %[temp], 0x00) \
MMI_LQC1($f27, $f26, %[temp], 0x10) \
MMI_LQC1($f29, $f28, %[temp], 0x20) \
MMI_LQC1($f31, $f30, %[temp], 0x30) \
: \
: [temp]"r"(temp_backup_reg) \
: "memory" \
); \
else \
__asm__ volatile ( \
MMI_LQC1($f22, $f20, %[temp], 0x10) \
MMI_LQC1($f26, $f24, %[temp], 0x10) \
MMI_LQC1($f30, $f28, %[temp], 0x20) \
: \
: [temp]"r"(temp_backup_reg) \
: "memory" \
);

recover register

Definition at line 260 of file mmiutils.h.

◆ TRANSPOSE_2W

#define TRANSPOSE_2W (   fr_i0,
  fr_i1,
  fr_o0,
  fr_o1 
)
Value:
"punpcklwd "#fr_o0", "#fr_i0", "#fr_i1" \n\t" \
"punpckhwd "#fr_o1", "#fr_i0", "#fr_i1" \n\t"

brief: Transpose 2X2 word packaged data.

fr_i0, fr_i1: src fr_o0, fr_o1: dst

Definition at line 286 of file mmiutils.h.

◆ TRANSPOSE_4H

#define TRANSPOSE_4H (   fr_i0,
  fr_i1,
  fr_i2,
  fr_i3,
  fr_t0,
  fr_t1,
  fr_t2,
  fr_t3 
)
Value:
"punpcklhw "#fr_t0", "#fr_i0", "#fr_i1" \n\t" \
"punpckhhw "#fr_t1", "#fr_i0", "#fr_i1" \n\t" \
"punpcklhw "#fr_t2", "#fr_i2", "#fr_i3" \n\t" \
"punpckhhw "#fr_t3", "#fr_i2", "#fr_i3" \n\t" \
"punpcklwd "#fr_i0", "#fr_t0", "#fr_t2" \n\t" \
"punpckhwd "#fr_i1", "#fr_t0", "#fr_t2" \n\t" \
"punpcklwd "#fr_i2", "#fr_t1", "#fr_t3" \n\t" \
"punpckhwd "#fr_i3", "#fr_t1", "#fr_t3" \n\t"

brief: Transpose 4X4 half word packaged data.

fr_i0, fr_i1, fr_i2, fr_i3: src & dst fr_t0, fr_t1, fr_t2, fr_t3: temporary register

Definition at line 295 of file mmiutils.h.

◆ TRANSPOSE_8B

#define TRANSPOSE_8B (   fr_i0,
  fr_i1,
  fr_i2,
  fr_i3,
  fr_i4,
  fr_i5,
  fr_i6,
  fr_i7,
  fr_t0,
  fr_t1,
  fr_t2,
  fr_t3 
)
Value:
"punpcklbh "#fr_t0", "#fr_i0", "#fr_i1" \n\t" \
"punpckhbh "#fr_t1", "#fr_i0", "#fr_i1" \n\t" \
"punpcklbh "#fr_t2", "#fr_i2", "#fr_i3" \n\t" \
"punpckhbh "#fr_t3", "#fr_i2", "#fr_i3" \n\t" \
"punpcklbh "#fr_i0", "#fr_i4", "#fr_i5" \n\t" \
"punpckhbh "#fr_i1", "#fr_i4", "#fr_i5" \n\t" \
"punpcklbh "#fr_i2", "#fr_i6", "#fr_i7" \n\t" \
"punpckhbh "#fr_i3", "#fr_i6", "#fr_i7" \n\t" \
"punpcklhw "#fr_i4", "#fr_t0", "#fr_t2" \n\t" \
"punpckhhw "#fr_i5", "#fr_t0", "#fr_t2" \n\t" \
"punpcklhw "#fr_i6", "#fr_t1", "#fr_t3" \n\t" \
"punpckhhw "#fr_i7", "#fr_t1", "#fr_t3" \n\t" \
"punpcklhw "#fr_t0", "#fr_i0", "#fr_i2" \n\t" \
"punpckhhw "#fr_t1", "#fr_i0", "#fr_i2" \n\t" \
"punpcklhw "#fr_t2", "#fr_i1", "#fr_i3" \n\t" \
"punpckhhw "#fr_t3", "#fr_i1", "#fr_i3" \n\t" \
"punpcklwd "#fr_i0", "#fr_i4", "#fr_t0" \n\t" \
"punpckhwd "#fr_i1", "#fr_i4", "#fr_t0" \n\t" \
"punpcklwd "#fr_i2", "#fr_i5", "#fr_t1" \n\t" \
"punpckhwd "#fr_i3", "#fr_i5", "#fr_t1" \n\t" \
"punpcklwd "#fr_i4", "#fr_i6", "#fr_t2" \n\t" \
"punpckhwd "#fr_i5", "#fr_i6", "#fr_t2" \n\t" \
"punpcklwd "#fr_i6", "#fr_i7", "#fr_t3" \n\t" \
"punpckhwd "#fr_i7", "#fr_i7", "#fr_t3" \n\t"

brief: Transpose 8x8 byte packaged data.

fr_i0~i7: src & dst fr_t0~t3: temporary register

Definition at line 311 of file mmiutils.h.

◆ PSRAB_MMI

#define PSRAB_MMI (   fr_i0,
  fr_i1,
  fr_t0,
  fr_t1,
  fr_d0 
)
Value:
"punpcklbh "#fr_t0", "#fr_t0", "#fr_i0" \n\t" \
"punpckhbh "#fr_t1", "#fr_t1", "#fr_i0" \n\t" \
"psrah "#fr_t0", "#fr_t0", "#fr_i1" \n\t" \
"psrah "#fr_t1", "#fr_t1", "#fr_i1" \n\t" \
"packsshb "#fr_d0", "#fr_t0", "#fr_t1" \n\t"

brief: Parallel SRA for 8 byte packaged data.

fr_i0: src fr_i1: SRA number(SRAB number + 8) fr_t0, fr_t1: temporary register fr_d0: dst

Definition at line 345 of file mmiutils.h.

◆ PSRLB_MMI

#define PSRLB_MMI (   fr_i0,
  fr_i1,
  fr_t0,
  fr_t1,
  fr_d0 
)
Value:
"punpcklbh "#fr_t0", "#fr_t0", "#fr_i0" \n\t" \
"punpckhbh "#fr_t1", "#fr_t1", "#fr_i0" \n\t" \
"psrlh "#fr_t0", "#fr_t0", "#fr_i1" \n\t" \
"psrlh "#fr_t1", "#fr_t1", "#fr_i1" \n\t" \
"packsshb "#fr_d0", "#fr_t0", "#fr_t1" \n\t"

brief: Parallel SRL for 8 byte packaged data.

fr_i0: src fr_i1: SRL number(SRLB number + 8) fr_t0, fr_t1: temporary register fr_d0: dst

Definition at line 359 of file mmiutils.h.

◆ PSRAH_4_MMI

#define PSRAH_4_MMI (   fp1,
  fp2,
  fp3,
  fp4,
  shift 
)
Value:
"psrah "#fp1", "#fp1", "#shift" \n\t" \
"psrah "#fp2", "#fp2", "#shift" \n\t" \
"psrah "#fp3", "#fp3", "#shift" \n\t" \
"psrah "#fp4", "#fp4", "#shift" \n\t"

Definition at line 366 of file mmiutils.h.

◆ PSRAH_8_MMI

#define PSRAH_8_MMI (   fp1,
  fp2,
  fp3,
  fp4,
  fp5,
  fp6,
  fp7,
  fp8,
  shift 
)
Value:
PSRAH_4_MMI(fp1, fp2, fp3, fp4, shift) \
PSRAH_4_MMI(fp5, fp6, fp7, fp8, shift)

Definition at line 372 of file mmiutils.h.

◆ ROUND_POWER_OF_TWO_MMI

#define ROUND_POWER_OF_TWO_MMI (   fr_i0,
  fr_i1,
  fr_t0,
  fr_t1,
  gr_t0 
)
Value:
"li "#gr_t0", 0x01 \n\t" \
"dmtc1 "#gr_t0", "#fr_t0" \n\t" \
"punpcklwd "#fr_t0", "#fr_t0", "#fr_t0" \n\t" \
"psubw "#fr_t1", "#fr_i1", "#fr_t0" \n\t" \
"psllw "#fr_t1", "#fr_t0", "#fr_t1" \n\t" \
"paddw "#fr_i0", "#fr_i0", "#fr_t1" \n\t" \
"psraw "#fr_i0", "#fr_i0", "#fr_i1" \n\t"

brief: (((value) + (1 << ((n) - 1))) >> (n)) fr_i0: src & dst fr_i1: Operand number fr_t0, fr_t1: temporary FPR gr_t0: temporary GPR

Definition at line 383 of file mmiutils.h.

PSRAH_4_MMI
#define PSRAH_4_MMI(fp1, fp2, fp3, fp4, shift)
Definition: mmiutils.h:366
LOCAL_ALIGNED_16
#define LOCAL_ALIGNED_16(t, v,...)
Definition: mem_internal.h:150
shift
static int shift(int a, int b)
Definition: bonk.c:262
temp
else temp
Definition: vf_mcdeint.c:263