31 #ifndef __ARCH_MIPS_DSP_HH__
32 #define __ARCH_MIPS_DSP_HH__
87 { 0x0000003f, 0x00001f80, 0x00002000,
88 0x00ff0000, 0x0f000000, 0x00004000 };
133 int32_t
bitrev(int32_t value);
134 uint64_t
dspSaturate(uint64_t value, int32_t fmt, int32_t sign,
136 uint64_t
checkOverflow(uint64_t value, int32_t fmt, int32_t sign,
138 uint64_t
signExtend(uint64_t value, int32_t signpos);
139 uint64_t
addHalfLsb(uint64_t value, int32_t lsbpos);
140 int32_t
dspAbs(int32_t
a, int32_t fmt, uint32_t *dspctl);
141 int32_t
dspAdd(int32_t
a, int32_t
b, int32_t fmt, int32_t saturate,
142 int32_t sign, uint32_t *dspctl);
143 int32_t
dspAddh(int32_t
a, int32_t
b, int32_t fmt, int32_t round,
145 int32_t
dspSub(int32_t
a, int32_t
b, int32_t fmt, int32_t saturate,
146 int32_t sign, uint32_t *dspctl);
147 int32_t
dspSubh(int32_t
a, int32_t
b, int32_t fmt, int32_t round,
149 int32_t
dspShll(int32_t
a, uint32_t
sa, int32_t fmt, int32_t saturate,
150 int32_t sign, uint32_t *dspctl);
151 int32_t
dspShrl(int32_t
a, uint32_t
sa, int32_t fmt, int32_t sign);
152 int32_t
dspShra(int32_t
a, uint32_t
sa, int32_t fmt, int32_t round,
153 int32_t sign, uint32_t *dspctl);
154 int32_t
dspMul(int32_t
a, int32_t
b, int32_t fmt, int32_t saturate,
156 int32_t
dspMulq(int32_t
a, int32_t
b, int32_t fmt, int32_t saturate,
157 int32_t round, uint32_t *dspctl);
158 int32_t
dspMuleu(int32_t
a, int32_t
b, int32_t
mode, uint32_t *dspctl);
159 int32_t
dspMuleq(int32_t
a, int32_t
b, int32_t
mode, uint32_t *dspctl);
160 int64_t
dspDpaq(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac,
161 int32_t infmt, int32_t outfmt, int32_t postsat, int32_t
mode,
163 int64_t
dspDpsq(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac,
164 int32_t infmt, int32_t outfmt, int32_t postsat, int32_t
mode,
166 int64_t
dspDpa(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac, int32_t fmt,
167 int32_t sign, int32_t
mode);
168 int64_t
dspDps(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac, int32_t fmt,
169 int32_t sign, int32_t
mode);
170 int64_t
dspMaq(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac,
171 int32_t fmt, int32_t
mode, int32_t saturate, uint32_t *dspctl);
172 int64_t
dspMulsa(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac, int32_t fmt);
173 int64_t
dspMulsaq(int64_t dspac, int32_t
a, int32_t
b, int32_t
ac, int32_t fmt,
175 void dspCmp(int32_t
a, int32_t
b, int32_t fmt, int32_t sign, int32_t
op,
177 int32_t
dspCmpg(int32_t
a, int32_t
b, int32_t fmt, int32_t sign, int32_t
op);
178 int32_t
dspCmpgd(int32_t
a, int32_t
b, int32_t fmt, int32_t sign, int32_t
op,
180 int32_t
dspPrece(int32_t
a, int32_t infmt, int32_t insign, int32_t outfmt,
181 int32_t outsign, int32_t
mode);
182 int32_t
dspPrecrqu(int32_t
a, int32_t
b, uint32_t *dspctl);
183 int32_t
dspPrecrq(int32_t
a, int32_t
b, int32_t fmt, uint32_t *dspctl);
186 int32_t
dspPick(int32_t
a, int32_t
b, int32_t fmt, uint32_t *dspctl);
187 int32_t
dspPack(int32_t
a, int32_t
b, int32_t fmt);
188 int32_t
dspExtr(int64_t dspac, int32_t fmt, int32_t
sa, int32_t round,
189 int32_t saturate, uint32_t *dspctl);
190 int32_t
dspExtp(int64_t dspac, int32_t
size, uint32_t *dspctl);
191 int32_t
dspExtpd(int64_t dspac, int32_t
size, uint32_t *dspctl);
194 void simdPack(uint64_t *values_ptr, int32_t *
reg, int32_t fmt);
195 void simdUnpack(int32_t
reg, uint64_t *values_ptr, int32_t fmt, int32_t sign);
203 #endif // __ARCH_MIPS_DSP_HH__
const uint32_t SIMD_MAX_VALS
void dspCmp(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op, uint32_t *dspctl)
int32_t dspShll(int32_t a, uint32_t sa, int32_t fmt, int32_t saturate, int32_t sign, uint32_t *dspctl)
const uint64_t FIXED_L_UMIN
const uint32_t SIMD_LOG2N[SIMD_NUM_FMTS]
int64_t dspDpa(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt, int32_t sign, int32_t mode)
const uint64_t FIXED_B_SMIN
uint64_t dspSaturate(uint64_t value, int32_t fmt, int32_t sign, uint32_t *overflow)
int32_t dspPrecrSra(int32_t a, int32_t b, int32_t sa, int32_t fmt, int32_t round)
int32_t dspExtp(int64_t dspac, int32_t size, uint32_t *dspctl)
int32_t dspPick(int32_t a, int32_t b, int32_t fmt, uint32_t *dspctl)
const uint32_t SIMD_NVALS[SIMD_NUM_FMTS]
uint64_t checkOverflow(uint64_t value, int32_t fmt, int32_t sign, uint32_t *overflow)
int64_t dspMaq(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt, int32_t mode, int32_t saturate, uint32_t *dspctl)
int64_t dspDpsq(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t infmt, int32_t outfmt, int32_t postsat, int32_t mode, uint32_t *dspctl)
int32_t dspAbs(int32_t a, int32_t fmt, uint32_t *dspctl)
const uint64_t FIXED_H_UMIN
int32_t dspMulq(int32_t a, int32_t b, int32_t fmt, int32_t saturate, int32_t round, uint32_t *dspctl)
const uint64_t FIXED_B_SMAX
int32_t dspMul(int32_t a, int32_t b, int32_t fmt, int32_t saturate, uint32_t *dspctl)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
const uint64_t FIXED_B_UMAX
int32_t dspExtpd(int64_t dspac, int32_t size, uint32_t *dspctl)
uint64_t signExtend(uint64_t value, int32_t signpos)
const uint64_t FIXED_W_SMAX
int32_t dspPrecrq(int32_t a, int32_t b, int32_t fmt, uint32_t *dspctl)
const uint32_t DSP_CTL_POS[DSP_NUM_FIELDS]
void simdUnpack(int32_t reg, uint64_t *values_ptr, int32_t fmt, int32_t sign)
const uint32_t DSP_CTL_MASK[DSP_NUM_FIELDS]
int32_t dspPrece(int32_t a, int32_t infmt, int32_t insign, int32_t outfmt, int32_t outsign, int32_t mode)
int32_t dspCmpg(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op)
void simdPack(uint64_t *values_ptr, int32_t *reg, int32_t fmt)
int32_t dspSub(int32_t a, int32_t b, int32_t fmt, int32_t saturate, int32_t sign, uint32_t *dspctl)
const uint64_t FIXED_UMAX[SIMD_NUM_FMTS]
const uint64_t FIXED_W_SMIN
const uint64_t FIXED_L_SMAX
int32_t dspAdd(int32_t a, int32_t b, int32_t fmt, int32_t saturate, int32_t sign, uint32_t *dspctl)
uint32_t readDSPControl(uint32_t *dspctl, uint32_t mask)
int32_t dspPrecrqu(int32_t a, int32_t b, uint32_t *dspctl)
const uint64_t FIXED_H_SMAX
int32_t dspShra(int32_t a, uint32_t sa, int32_t fmt, int32_t round, int32_t sign, uint32_t *dspctl)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
int32_t dspCmpgd(int32_t a, int32_t b, int32_t fmt, int32_t sign, int32_t op, uint32_t *dspctl)
#define ULL(N)
uint64_t constant
void writeDSPControl(uint32_t *dspctl, uint32_t value, uint32_t mask)
int32_t dspShrl(int32_t a, uint32_t sa, int32_t fmt, int32_t sign)
const uint64_t FIXED_SMIN[SIMD_NUM_FMTS]
const uint64_t FIXED_W_UMAX
const uint64_t FIXED_L_UMAX
const uint64_t FIXED_H_UMAX
int64_t dspDpaq(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t infmt, int32_t outfmt, int32_t postsat, int32_t mode, uint32_t *dspctl)
const uint64_t FIXED_H_SMIN
int32_t bitrev(int32_t value)
const uint32_t SIMD_NBITS[SIMD_NUM_FMTS]
int64_t dspMulsaq(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt, uint32_t *dspctl)
int32_t dspMuleq(int32_t a, int32_t b, int32_t mode, uint32_t *dspctl)
int32_t dspSubh(int32_t a, int32_t b, int32_t fmt, int32_t round, int32_t sign)
const uint64_t FIXED_UMIN[SIMD_NUM_FMTS]
uint64_t addHalfLsb(uint64_t value, int32_t lsbpos)
const uint64_t FIXED_SMAX[SIMD_NUM_FMTS]
const uint64_t FIXED_B_UMIN
const uint64_t FIXED_L_SMIN
int64_t dspMulsa(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt)
int32_t dspExtr(int64_t dspac, int32_t fmt, int32_t sa, int32_t round, int32_t saturate, uint32_t *dspctl)
int64_t dspDps(int64_t dspac, int32_t a, int32_t b, int32_t ac, int32_t fmt, int32_t sign, int32_t mode)
int32_t dspMuleu(int32_t a, int32_t b, int32_t mode, uint32_t *dspctl)
int32_t dspAddh(int32_t a, int32_t b, int32_t fmt, int32_t round, int32_t sign)
const uint64_t FIXED_W_UMIN
int32_t dspPack(int32_t a, int32_t b, int32_t fmt)