On Wed, Oct 29, 2014 at 01:41:58AM +0000, Yongbok Kim wrote: > add MSA I8 format instructions > > Reviewed-by: James Hogan <james.ho...@imgtec.com>
The patch has changed quite a lot, so probably worth dropping Reviewed-by in those cases in future. > Signed-off-by: Yongbok Kim <yongbok....@imgtec.com> > +#define MSA_FN_IMM8(FUNC, DEST, OPERATION) \ > +void helper_msa_ ## FUNC(CPUMIPSState *env, uint32_t wd, uint32_t ws, \ > + uint32_t i8) \ > +{ \ > + wr_t *pwd = &(env->active_fpu.fpr[wd].wr); \ > + wr_t *pws = &(env->active_fpu.fpr[ws].wr); \ > + uint32_t i; \ > + for (i = 0; i < DF_ELEMENTS(DF_BYTE); i++) { \ > + DEST = OPERATION; \ > + } \ I presume register partitioning isn't going to be supported in this round of patches? Okay. > +} > + > +MSA_FN_IMM8(andi_b, pwd->b[i], pws->b[i] & i8) > +MSA_FN_IMM8(ori_b, pwd->b[i], pws->b[i] | i8) > +MSA_FN_IMM8(nori_b, pwd->b[i], ~(pws->b[i] | i8)) > +MSA_FN_IMM8(xori_b, pwd->b[i], pws->b[i] ^ i8) > + > +#define BIT_MOVE_IF_NOT_ZERO(dest, arg1, arg2, df) \ > + UNSIGNED(((dest & (~arg2)) | (arg1 & arg2)), df) > +MSA_FN_IMM8(bmnzi_b, pwd->b[i], \ no need to escape the newline > + BIT_MOVE_IF_NOT_ZERO(pwd->b[i], pws->b[i], i8, DF_BYTE)) > + > +#define BIT_MOVE_IF_ZERO(dest, arg1, arg2, df) \ > + UNSIGNED((dest & arg2) | (arg1 & (~arg2)), df) > +MSA_FN_IMM8(bmzi_b, pwd->b[i], \ same > + BIT_MOVE_IF_ZERO(pwd->b[i], pws->b[i], i8, DF_BYTE)) > + > +#define BIT_SELECT(dest, arg1, arg2, df) \ > + UNSIGNED((arg1 & (~dest)) | (arg2 & dest), df) > +MSA_FN_IMM8(bseli_b, pwd->b[i], \ same > + BIT_SELECT(pwd->b[i], pws->b[i], i8, DF_BYTE)) > + > +#undef MSA_FN_IMM8 > + > +#define SHF_POS(i, imm) ((i & 0xfc) + ((imm >> (2 * (i & 0x03))) & 0x03)) Should probably put brackets around macro arguments here, just for the sake of robustness. Otherwise Reviewed-by: James Hogan <james.ho...@imgtec.com> Cheers James