new_dynarec: No need to use pc relative address to access fcr31

This commit is contained in:
Gillou68310 2019-01-17 10:34:21 +01:00
parent ec34b4522a
commit 0db19722d1

View File

@ -4368,7 +4368,7 @@ static void fconv_assemble_arm64(int i,struct regstat *i_regs)
save_regs(reglist);
if(opcode2[i]==0x14&&(source[i]&0x3f)==0x20) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_s_w);
@ -4379,13 +4379,13 @@ static void fconv_assemble_arm64(int i,struct regstat *i_regs)
emit_call((intptr_t)cvt_d_w);
}
if(opcode2[i]==0x15&&(source[i]&0x3f)==0x20) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_s_l);
}
if(opcode2[i]==0x15&&(source[i]&0x3f)==0x21) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_d_l);
@ -4397,32 +4397,32 @@ static void fconv_assemble_arm64(int i,struct regstat *i_regs)
emit_call((intptr_t)cvt_d_s);
}
if(opcode2[i]==0x10&&(source[i]&0x3f)==0x24) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_w_s);
}
if(opcode2[i]==0x10&&(source[i]&0x3f)==0x25) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_l_s);
}
if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_s_d);
}
if(opcode2[i]==0x11&&(source[i]&0x3f)==0x24) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_w_d);
}
if(opcode2[i]==0x11&&(source[i]&0x3f)==0x25) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG);
emit_call((intptr_t)cvt_l_d);
@ -4597,7 +4597,7 @@ static void fcomp_assemble(int i,struct regstat *i_regs)
reglist&=~(1<<fs);
save_regs(reglist);
if(opcode2[i]==0x10) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>16)&0x1f],ARG3_REG);
if((source[i]&0x3f)==0x30) emit_call((intptr_t)c_f_s);
@ -4618,7 +4618,7 @@ static void fcomp_assemble(int i,struct regstat *i_regs)
if((source[i]&0x3f)==0x3f) emit_call((intptr_t)c_ngt_s);
}
if(opcode2[i]==0x11) {
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>16)&0x1f],ARG3_REG);
if((source[i]&0x3f)==0x30) emit_call((intptr_t)c_f_d);
@ -4792,13 +4792,13 @@ static void float_assemble(int i,struct regstat *i_regs)
switch(source[i]&0x3f)
{
case 0x00: case 0x01: case 0x02: case 0x03:
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>16)&0x1f],ARG3_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG4_REG);
break;
case 0x04:
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG);
break;
@ -4825,13 +4825,13 @@ static void float_assemble(int i,struct regstat *i_regs)
switch(source[i]&0x3f)
{
case 0x00: case 0x01: case 0x02: case 0x03:
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>16)&0x1f],ARG3_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG4_REG);
break;
case 0x04:
emit_pc_relative_addr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.fcr31,ARG1_REG);
emit_addimm64(FP,fp_fcr31,ARG1_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG);
emit_readptr((intptr_t)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG);
break;