Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2017-02-20 02:39:57 +01:00
commit d0759e41a1
2 changed files with 10 additions and 12 deletions

View File

@ -453,14 +453,11 @@ static void asm_conv(ASMState *as, IRIns *ir)
/* y = (x ^ 0x8000000) + 2147483648.0 */
Reg left = ra_alloc1(as, lref, RSET_GPR);
Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, dest));
emit_fgh(as, irt_isfloat(ir->t) ? MIPSI_ADD_S : MIPSI_ADD_D,
dest, dest, tmp);
emit_fg(as, irt_isfloat(ir->t) ? MIPSI_CVT_S_W : MIPSI_CVT_D_W,
dest, dest);
if (irt_isfloat(ir->t))
emit_lsptr(as, MIPSI_LWC1, (tmp & 31),
(void *)&as->J->k32[LJ_K32_2P31], RSET_GPR);
else
emit_fg(as, MIPSI_CVT_S_D, dest, dest);
/* Must perform arithmetic with doubles to keep the precision. */
emit_fgh(as, MIPSI_ADD_D, dest, dest, tmp);
emit_fg(as, MIPSI_CVT_D_W, dest, dest);
emit_lsptr(as, MIPSI_LDC1, (tmp & 31),
(void *)&as->J->k64[LJ_K64_2P31], RSET_GPR);
emit_tg(as, MIPSI_MTC1, RID_TMP, dest);

View File

@ -32,6 +32,7 @@ enum {
RID_MAX,
RID_ZERO = RID_R0,
RID_TMP = RID_RA,
RID_GP = RID_R28,
/* Calling conventions. */
RID_RET = RID_R2,
@ -74,10 +75,10 @@ enum {
/* -- Register sets ------------------------------------------------------- */
/* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2 and JGL. */
/* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2, JGL and GP. */
#define RSET_FIXED \
(RID2RSET(RID_ZERO)|RID2RSET(RID_TMP)|RID2RSET(RID_SP)|\
RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL))
RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL)|RID2RSET(RID_GP))
#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)
#if LJ_SOFTFP
#define RSET_FPR 0
@ -97,7 +98,7 @@ enum {
#define RSET_SCRATCH_GPR \
(RSET_RANGE(RID_R1, RID_R15+1)|\
RID2RSET(RID_R24)|RID2RSET(RID_R25)|RID2RSET(RID_R28))
RID2RSET(RID_R24)|RID2RSET(RID_R25))
#if LJ_SOFTFP
#define RSET_SCRATCH_FPR 0
#else