Reverted latest JIT improvements, since they introduced a bug - bumped version to 2.20 beta

This commit is contained in:
Dimitris Panokostas 2018-04-24 21:21:15 +02:00
parent b46f477887
commit fdb2b54b22
14 changed files with 4913 additions and 5007 deletions

View file

@ -82,11 +82,11 @@ extern void __clear_cache (char*, char*);
//#define REG_DATAPTR R10_INDEX //#define REG_DATAPTR R10_INDEX
#define REG_PC_PRE R0_INDEX /* The register we use for preloading regs.pc_p */
#define REG_PC_TMP R1_INDEX /* Another register that is not the above */ #define REG_PC_TMP R1_INDEX /* Another register that is not the above */
#define R_MEMSTART 10
#define R_REGSTRUCT 11 #define R_REGSTRUCT 11
uae_s8 always_used[]={2,3,R_MEMSTART,R_REGSTRUCT,12,-1}; // r2, r3 and r12 are work register in emitted code uae_s8 always_used[]={2,3,R_REGSTRUCT,12,-1}; // r2, r3 and r12 are work register in emitted code
uae_u8 call_saved[]={0,0,0,0, 1,1,1,1, 1,1,1,1, 0,1,1,1}; uae_u8 call_saved[]={0,0,0,0, 1,1,1,1, 1,1,1,1, 0,1,1,1};
@ -666,7 +666,7 @@ STATIC_INLINE void compemu_raw_branch(IMM d)
} }
// Optimize access to struct regstruct with r11 and memory with r10 // Optimize access to struct regstruct with r11
LOWFUNC(NONE,NONE,1,compemu_raw_init_r_regstruct,(IMM s)) LOWFUNC(NONE,NONE,1,compemu_raw_init_r_regstruct,(IMM s))
{ {
@ -677,8 +677,6 @@ LOWFUNC(NONE,NONE,1,compemu_raw_init_r_regstruct,(IMM s))
uae_s32 offs = data_long_offs(s); uae_s32 offs = data_long_offs(s);
LDR_rRI(R_REGSTRUCT, RPC_INDEX, offs); LDR_rRI(R_REGSTRUCT, RPC_INDEX, offs);
#endif #endif
uae_s32 offsmem = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(R_MEMSTART, R_REGSTRUCT, offsmem);
} }
LENDFUNC(NONE,NONE,1,compemu_raw_init_r_regstruct,(IMM s)) LENDFUNC(NONE,NONE,1,compemu_raw_init_r_regstruct,(IMM s))
@ -778,8 +776,6 @@ LENDFUNC(NONE,READ,2,compemu_raw_tag_pc,(W4 d, MEMR s))
* FPU stuff * * FPU stuff *
*************************************************************************/ *************************************************************************/
#ifdef USE_JIT_FPU
LOWFUNC(NONE,NONE,2,raw_fmov_rr,(FW d, FR s)) LOWFUNC(NONE,NONE,2,raw_fmov_rr,(FW d, FR s))
{ {
VMOV64_dd(d, s); VMOV64_dd(d, s);
@ -791,8 +787,13 @@ LOWFUNC(NONE,WRITE,2,compemu_raw_fmov_mr_drop,(MEMW mem, FR s))
if(mem >= (uae_u32) &regs && mem < (uae_u32) &regs + 1020 && ((mem - (uae_u32) &regs) & 0x3) == 0) { if(mem >= (uae_u32) &regs && mem < (uae_u32) &regs + 1020 && ((mem - (uae_u32) &regs) & 0x3) == 0) {
VSTR64_dRi(s, R_REGSTRUCT, (mem - (uae_u32) &regs)); VSTR64_dRi(s, R_REGSTRUCT, (mem - (uae_u32) &regs));
} else { } else {
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, mem); MOVW_ri16(REG_WORK1, mem);
MOVT_ri16(REG_WORK1, mem >> 16); MOVT_ri16(REG_WORK1, mem >> 16);
#else
auto offs = data_long_offs(mem);
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
VSTR64_dRi(s, REG_WORK1, 0); VSTR64_dRi(s, REG_WORK1, 0);
} }
} }
@ -804,8 +805,13 @@ LOWFUNC(NONE,READ,2,compemu_raw_fmov_rm,(FW d, MEMR mem))
if(mem >= (uae_u32) &regs && mem < (uae_u32) &regs + 1020 && ((mem - (uae_u32) &regs) & 0x3) == 0) { if(mem >= (uae_u32) &regs && mem < (uae_u32) &regs + 1020 && ((mem - (uae_u32) &regs) & 0x3) == 0) {
VLDR64_dRi(d, R_REGSTRUCT, (mem - (uae_u32) &regs)); VLDR64_dRi(d, R_REGSTRUCT, (mem - (uae_u32) &regs));
} else { } else {
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, mem); MOVW_ri16(REG_WORK1, mem);
MOVT_ri16(REG_WORK1, mem >> 16); MOVT_ri16(REG_WORK1, mem >> 16);
#else
auto offs = data_long_offs(mem);
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
VLDR64_dRi(d, REG_WORK1, 0); VLDR64_dRi(d, REG_WORK1, 0);
} }
} }
@ -920,16 +926,26 @@ LENDFUNC(NONE,NONE,1,raw_fmov_d_ri_10,(FW r))
LOWFUNC(NONE,READ,2,raw_fmov_d_rm,(FW r, MEMR m)) LOWFUNC(NONE,READ,2,raw_fmov_d_rm,(FW r, MEMR m))
{ {
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, m); MOVW_ri16(REG_WORK1, m);
MOVT_ri16(REG_WORK1, m >> 16); MOVT_ri16(REG_WORK1, m >> 16);
#else
auto offs = data_long_offs(m);
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
VLDR64_dRi(r, REG_WORK1, 0); VLDR64_dRi(r, REG_WORK1, 0);
} }
LENDFUNC(NONE,READ,2,raw_fmov_d_rm,(FW r, MEMR m)) LENDFUNC(NONE,READ,2,raw_fmov_d_rm,(FW r, MEMR m))
LOWFUNC(NONE,READ,2,raw_fmovs_rm,(FW r, MEMR m)) LOWFUNC(NONE,READ,2,raw_fmovs_rm,(FW r, MEMR m))
{ {
MOVW_ri16(REG_WORK1, m); #ifdef ARMV6T2
MOVT_ri16(REG_WORK1, m >> 16); MOVW_ri16(REG_WORK1, m);
MOVT_ri16(REG_WORK1, m >> 16);
#else
auto offs = data_long_offs(m);
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
VLDR32_sRi(SCRATCH_F32_1, REG_WORK1, 0); VLDR32_sRi(SCRATCH_F32_1, REG_WORK1, 0);
VCVT32to64_ds(r, SCRATCH_F32_1); VCVT32to64_ds(r, SCRATCH_F32_1);
} }
@ -1061,10 +1077,13 @@ LENDFUNC(NONE,NONE,2,raw_fmovs_rr,(FW d, FR s))
LOWFUNC(NONE,NONE,3,raw_ffunc_rr,(double (*func)(double), FW d, FR s)) LOWFUNC(NONE,NONE,3,raw_ffunc_rr,(double (*func)(double), FW d, FR s))
{ {
VMOV64_dd(0, s); VMOV64_dd(0, s);
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, (uae_u32)func); MOVW_ri16(REG_WORK1, (uae_u32)func);
MOVT_ri16(REG_WORK1, ((uae_u32)func) >> 16); MOVT_ri16(REG_WORK1, ((uae_u32)func) >> 16);
#else
auto offs = data_long_offs(uae_u32(func));
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
PUSH(RLR_INDEX); PUSH(RLR_INDEX);
BLX_r(REG_WORK1); BLX_r(REG_WORK1);
POP(RLR_INDEX); POP(RLR_INDEX);
@ -1085,8 +1104,13 @@ LOWFUNC(NONE,NONE,3,raw_fpowx_rr,(uae_u32 x, FW d, FR s))
VMOV64_dd(1, s); VMOV64_dd(1, s);
MOVW_ri16(REG_WORK1, (uae_u32)func); #ifdef ARMV6T2
MOVT_ri16(REG_WORK1, ((uae_u32)func) >> 16); MOVW_ri16(REG_WORK1, (uae_u32)func);
MOVT_ri16(REG_WORK1, ((uae_u32)func) >> 16);
#else
auto offs = data_long_offs(uae_u32(func));
LDR_rRI(REG_WORK1, RPC_INDEX, offs);
#endif
PUSH(RLR_INDEX); PUSH(RLR_INDEX);
BLX_r(REG_WORK1); BLX_r(REG_WORK1);
@ -1098,22 +1122,24 @@ LENDFUNC(NONE,NONE,3,raw_fpowx_rr,(uae_u32 x, FW d, FR s))
LOWFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s)) LOWFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
VMOVi_to_ARM_rd(REG_WORK1, s, 1); // get high part of double VMOVi_to_ARM_rd(REG_WORK1, s, 1); // get high part of double
VCMP64_d0(s); VCMP64_d0(s);
VMRS_CPSR(); VMRS_CPSR();
#ifdef ARMV6T2 #ifdef ARMV6T2
BEQ_i(19); // iszero BEQ_i(20); // iszero
#else #else
BEQ_i(20); BEQ_i(21);
#endif #endif
UBFX_rrii(REG_WORK2, REG_WORK1, 20, 11); // get exponent UBFX_rrii(REG_WORK2, REG_WORK1, 20, 11); // get exponent
MOVW_ri16(REG_WORK3, 2047); MOVW_ri16(REG_WORK3, 2047);
CMP_rr(REG_WORK2, REG_WORK3); CMP_rr(REG_WORK2, REG_WORK3);
#ifdef ARMV6T2 #ifdef ARMV6T2
BEQ_i(12); // isnan BEQ_i(13); // isnan
#else #else
BEQ_i(13); BEQ_i(14);
#endif #endif
MOVW_ri16(REG_WORK3, 15360); // diff of bias between double and long double MOVW_ri16(REG_WORK3, 15360); // diff of bias between double and long double
@ -1121,7 +1147,8 @@ LOWFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s))
AND_rri(REG_WORK1, REG_WORK1, 0x80000000); // extract sign AND_rri(REG_WORK1, REG_WORK1, 0x80000000); // extract sign
ORR_rrrLSLi(REG_WORK2, REG_WORK1, REG_WORK2, 16); // merge sign and exponent ORR_rrrLSLi(REG_WORK2, REG_WORK1, REG_WORK2, 16); // merge sign and exponent
ADD_rrr(REG_WORK3, adr, R_MEMSTART); LDR_rRI(REG_WORK3, R_REGSTRUCT, offs);
ADD_rrr(REG_WORK3, adr, REG_WORK3);
REV_rr(REG_WORK2, REG_WORK2); REV_rr(REG_WORK2, REG_WORK2);
STRH_rR(REG_WORK2, REG_WORK3); // write exponent STRH_rR(REG_WORK2, REG_WORK3); // write exponent
@ -1132,11 +1159,11 @@ LOWFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s))
ORR_rri(REG_WORK1, REG_WORK1, 0x80); // insert explicit 1 ORR_rri(REG_WORK1, REG_WORK1, 0x80); // insert explicit 1
#ifdef ARMV6T2 #ifdef ARMV6T2
STRD_rRI(REG_WORK1, REG_WORK3, 4); STRD_rRI(REG_WORK1, REG_WORK3, 4);
B_i(8); // end_of_op B_i(9); // end_of_op
#else #else
STR_rRI(REG_WORK1, REG_WORK3, 4); STR_rRI(REG_WORK1, REG_WORK3, 4);
STR_rRI(REG_WORK2, REG_WORK3, 8); STR_rRI(REG_WORK2, REG_WORK3, 8);
B_i(9); B_i(10);
#endif #endif
// isnan // isnan
@ -1148,7 +1175,8 @@ LOWFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s))
CC_AND_rri(NATIVE_CC_EQ, REG_WORK1, REG_WORK1, 0x80000000); // extract sign CC_AND_rri(NATIVE_CC_EQ, REG_WORK1, REG_WORK1, 0x80000000); // extract sign
CC_MOV_ri(NATIVE_CC_EQ, REG_WORK2, 0); CC_MOV_ri(NATIVE_CC_EQ, REG_WORK2, 0);
ADD_rrr(REG_WORK3, adr, R_MEMSTART); LDR_rRI(REG_WORK3, R_REGSTRUCT, offs);
ADD_rrr(REG_WORK3, adr, REG_WORK3);
REV_rr(REG_WORK1, REG_WORK1); REV_rr(REG_WORK1, REG_WORK1);
#ifdef ARMV6T2 #ifdef ARMV6T2
@ -1166,7 +1194,10 @@ LENDFUNC(NONE,WRITE,2,raw_fp_from_exten_mr,(RR4 adr, FR s))
LOWFUNC(NONE,READ,2,raw_fp_to_exten_rm,(FW d, RR4 adr)) LOWFUNC(NONE,READ,2,raw_fp_to_exten_rm,(FW d, RR4 adr))
{ {
ADD_rrr(REG_WORK3, adr, R_MEMSTART); uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK3, R_REGSTRUCT, offs);
ADD_rrr(REG_WORK3, adr, REG_WORK3);
#ifdef ARMV6T2 #ifdef ARMV6T2
LDRD_rRI(REG_WORK1, REG_WORK3, 4); LDRD_rRI(REG_WORK1, REG_WORK3, 4);
@ -1213,7 +1244,10 @@ LENDFUNC(NONE,READ,2,raw_fp_to_exten_rm,(FW d, RR4 adr))
LOWFUNC(NONE,WRITE,2,raw_fp_from_double_mr,(RR4 adr, FR s)) LOWFUNC(NONE,WRITE,2,raw_fp_from_double_mr,(RR4 adr, FR s))
{ {
ADD_rrr(REG_WORK3, adr, R_MEMSTART); uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK3, R_REGSTRUCT, offs);
ADD_rrr(REG_WORK3, adr, REG_WORK3);
VREV64_8_dd(SCRATCH_F64_1, s); VREV64_8_dd(SCRATCH_F64_1, s);
VSTR64_dRi(SCRATCH_F64_1, REG_WORK3, 0); VSTR64_dRi(SCRATCH_F64_1, REG_WORK3, 0);
@ -1222,7 +1256,10 @@ LENDFUNC(NONE,WRITE,2,raw_fp_from_double_mr,(RR4 adr, FR s))
LOWFUNC(NONE,READ,2,raw_fp_to_double_rm,(FW d, RR4 adr)) LOWFUNC(NONE,READ,2,raw_fp_to_double_rm,(FW d, RR4 adr))
{ {
ADD_rrr(REG_WORK3, adr, R_MEMSTART); uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK3, R_REGSTRUCT, offs);
ADD_rrr(REG_WORK3, adr, REG_WORK3);
VLDR64_dRi(d, REG_WORK3, 0); VLDR64_dRi(d, REG_WORK3, 0);
VREV64_8_dd(d, d); VREV64_8_dd(d, d);
@ -1354,4 +1391,3 @@ LOWFUNC(NONE,NONE,1,raw_roundingmode,(IMM mode))
} }
LENDFUNC(NONE,NONE,1,raw_roundingmode,(IMM mode)) LENDFUNC(NONE,NONE,1,raw_roundingmode,(IMM mode))
#endif // USE_JIT_FPU

View file

@ -1327,7 +1327,8 @@ enum {
#define SMULxy_rrr(Rd,Rn,Rm,x,y) CC_SMULxy_rrr(NATIVE_CC_AL,Rd,Rn,Rm,x,y) #define SMULxy_rrr(Rd,Rn,Rm,x,y) CC_SMULxy_rrr(NATIVE_CC_AL,Rd,Rn,Rm,x,y)
// ARMv6T2 // ARMv6T2
#ifdef ARMV6T2 //#ifdef ARMV6T2
#if 1
#define CC_BFI_rrii(cc,Rd,Rn,lsb,msb) _W(((cc) << 28) | (0x3e << 21) | ((msb) << 16) | ((Rd) << 12) | ((lsb) << 7) | (0x1 << 4) | (Rn)) #define CC_BFI_rrii(cc,Rd,Rn,lsb,msb) _W(((cc) << 28) | (0x3e << 21) | ((msb) << 16) | ((Rd) << 12) | ((lsb) << 7) | (0x1 << 4) | (Rn))
#define BFI_rrii(Rd,Rn,lsb,msb) CC_BFI_rrii(NATIVE_CC_AL,Rd,Rn,lsb,msb) #define BFI_rrii(Rd,Rn,lsb,msb) CC_BFI_rrii(NATIVE_CC_AL,Rd,Rn,lsb,msb)

File diff suppressed because it is too large Load diff

View file

@ -123,7 +123,7 @@ typedef union {
#if defined(CPU_arm) #if defined(CPU_arm)
//#define DEBUG_DATA_BUFFER //#define DEBUG_DATA_BUFFER
#define ALIGN_NOT_NEEDED #define ALIGN_NOT_NEEDED
#define N_REGS 10 /* really 16, but 13 to 15 are SP, LR, PC; 12 is scratch reg, 10 holds memstart and 11 holds regs-struct */ #define N_REGS 11 /* really 16, but 13 to 15 are SP, LR, PC; 12 is scratch reg and 11 holds regs-struct */
#else #else
#define N_REGS 8 /* really only 7, but they are numbered 0,1,2,3,5,6,7 */ #define N_REGS 8 /* really only 7, but they are numbered 0,1,2,3,5,6,7 */
#endif #endif
@ -298,17 +298,17 @@ extern int failure;
/* Convenience functions exposed to gencomp */ /* Convenience functions exposed to gencomp */
extern uae_u32 m68k_pc_offset; extern uae_u32 m68k_pc_offset;
extern void readbyte(int address, int dest); extern void readbyte(int address, int dest, int tmp);
extern void readword(int address, int dest); extern void readword(int address, int dest, int tmp);
extern void readlong(int address, int dest); extern void readlong(int address, int dest, int tmp);
extern void writebyte(int address, int source); extern void writebyte(int address, int source, int tmp);
extern void writeword(int address, int source); extern void writeword(int address, int source, int tmp);
extern void writelong(int address, int source); extern void writelong(int address, int source, int tmp);
extern void writeword_clobber(int address, int source); extern void writeword_clobber(int address, int source, int tmp);
extern void writelong_clobber(int address, int source); extern void writelong_clobber(int address, int source, int tmp);
extern void get_n_addr(int address, int dest); extern void get_n_addr(int address, int dest, int tmp);
extern void get_n_addr_jmp(int address, int dest); extern void get_n_addr_jmp(int address, int dest, int tmp);
extern void calc_disp_ea_020(int base, uae_u32 dp, int target); extern void calc_disp_ea_020(int base, uae_u32 dp, int target, int tmp);
#define SYNC_PC_OFFSET 124 #define SYNC_PC_OFFSET 124
extern void sync_m68k_pc(void); extern void sync_m68k_pc(void);
extern uae_u32 get_const(int r); extern uae_u32 get_const(int r);

View file

@ -8,7 +8,7 @@
* Modified 2005 Peter Keunecke * Modified 2005 Peter Keunecke
*/ */
#include <cmath> #include <math.h>
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
@ -77,7 +77,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg)
case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */ case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */
{ {
uae_u32 dp = comp_get_iword ((m68k_pc_offset += 2) - 2); uae_u32 dp = comp_get_iword ((m68k_pc_offset += 2) - 2);
calc_disp_ea_020 (reg + 8, dp, S1); calc_disp_ea_020 (reg + 8, dp, S1, S2);
break; break;
} }
case 7: case 7:
@ -173,25 +173,25 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg)
switch (size) { switch (size) {
case 0: /* Long */ case 0: /* Long */
readlong (S1, S2); readlong (S1, S2, S3);
fmov_l_rr (treg, S2); fmov_l_rr (treg, S2);
return 2; return 2;
case 1: /* Single */ case 1: /* Single */
readlong (S1, S2); readlong (S1, S2, S3);
fmov_s_rr (treg, S2); fmov_s_rr (treg, S2);
return 1; return 1;
case 2: /* Long Double */ case 2: /* Long Double */
fp_to_exten_rm (treg, S1); fp_to_exten_rm (treg, S1);
return 0; return 0;
case 4: /* Word */ case 4: /* Word */
readword (S1, S2); readword (S1, S2, S3);
fmov_w_rr (treg, S2); fmov_w_rr (treg, S2);
return 1; return 1;
case 5: /* Double */ case 5: /* Double */
fp_to_double_rm (treg, S1); fp_to_double_rm (treg, S1);
return 2; return 2;
case 6: /* Byte */ case 6: /* Byte */
readbyte (S1, S2); readbyte (S1, S2, S3);
fmov_b_rr (treg, S2); fmov_b_rr (treg, S2);
return 1; return 1;
default: default:
@ -251,7 +251,7 @@ STATIC_INLINE int comp_fp_put (uae_u32 opcode, uae_u16 extra)
case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */ case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */
{ {
uae_u32 dp = comp_get_iword ((m68k_pc_offset += 2) - 2); uae_u32 dp = comp_get_iword ((m68k_pc_offset += 2) - 2);
calc_disp_ea_020 (reg + 8, dp, S1); calc_disp_ea_020 (reg + 8, dp, S1, S2);
break; break;
} }
case 7: case 7:
@ -276,25 +276,25 @@ STATIC_INLINE int comp_fp_put (uae_u32 opcode, uae_u16 extra)
switch (size) { switch (size) {
case 0: /* Long */ case 0: /* Long */
fmov_to_l_rr(S2, sreg); fmov_to_l_rr(S2, sreg);
writelong_clobber (S1, S2); writelong_clobber (S1, S2, S3);
return 0; return 0;
case 1: /* Single */ case 1: /* Single */
fmov_to_s_rr(S2, sreg); fmov_to_s_rr(S2, sreg);
writelong_clobber (S1, S2); writelong_clobber (S1, S2, S3);
return 0; return 0;
case 2:/* Long Double */ case 2:/* Long Double */
fp_from_exten_mr (S1, sreg); fp_from_exten_mr (S1, sreg);
return 0; return 0;
case 4: /* Word */ case 4: /* Word */
fmov_to_w_rr(S2, sreg); fmov_to_w_rr(S2, sreg);
writeword_clobber (S1, S2); writeword_clobber (S1, S2, S3);
return 0; return 0;
case 5: /* Double */ case 5: /* Double */
fp_from_double_mr(S1, sreg); fp_from_double_mr(S1, sreg);
return 0; return 0;
case 6: /* Byte */ case 6: /* Byte */
fmov_to_b_rr(S2, sreg); fmov_to_b_rr(S2, sreg);
writebyte (S1, S2); writebyte (S1, S2, S3);
return 0; return 0;
default: default:
return -1; return -1;

View file

@ -200,55 +200,23 @@ MIDFUNC(2,mov_l_mi,(IMM d, IMM s))
} }
MENDFUNC(2,mov_l_mi,(IMM d, IMM s)) MENDFUNC(2,mov_l_mi,(IMM d, IMM s))
MIDFUNC(4,disp_ea20_target_add,(RW4 target, RR4 reg, IMM shift, IMM extend)) MIDFUNC(2,shll_l_ri,(RW4 r, IMM i))
{ {
if(isconst(target) && isconst(reg)) { // Only used in calc_disp_ea_020() -> flags not relevant and never modified
if(extend) if (!i)
set_const(target, live.state[target].val + (((uae_s32)(uae_s16)live.state[reg].val) << (shift & 0x1f))); return;
else if (isconst(r)) {
set_const(target, live.state[target].val + (live.state[reg].val << (shift & 0x1f))); live.state[r].val <<= i;
return; return;
} }
reg = readreg(reg); r = rmw(r);
target = rmw(target);
if(extend) { LSL_rri(r,r, i & 0x1f);
SIGNED16_REG_2_REG(REG_WORK1, reg);
ADD_rrrLSLi(target, target, REG_WORK1, shift & 0x1f);
} else {
ADD_rrrLSLi(target, target, reg, shift & 0x1f);
}
unlock2(target); unlock2(r);
unlock2(reg);
} }
MENDFUNC(4,disp_ea20_target_add,(RW4 target, RR4 reg, IMM shift, IMM extend)) MENDFUNC(2,shll_l_ri,(RW4 r, IMM i))
MIDFUNC(4,disp_ea20_target_mov,(W4 target, RR4 reg, IMM shift, IMM extend))
{
if(isconst(reg)) {
if(extend)
set_const(target, ((uae_s32)(uae_s16)live.state[reg].val) << (shift & 0x1f));
else
set_const(target, live.state[reg].val << (shift & 0x1f));
return;
}
reg = readreg(reg);
target = writereg(target);
if(extend) {
SIGNED16_REG_2_REG(REG_WORK1, reg);
LSL_rri(target, REG_WORK1, shift & 0x1f);
} else {
LSL_rri(target, reg, shift & 0x1f);
}
unlock2(target);
unlock2(reg);
}
MENDFUNC(4,disp_ea20_target_mov,(W4 target, RR4 reg, IMM shift, IMM extend))
MIDFUNC(2,sign_extend_16_rr,(W4 d, RR2 s)) MIDFUNC(2,sign_extend_16_rr,(W4 d, RR2 s))
{ {
@ -510,6 +478,49 @@ MIDFUNC(2,sub_w_ri,(RW2 d, IMM i))
} }
MENDFUNC(2,sub_w_ri,(RW2 d, IMM i)) MENDFUNC(2,sub_w_ri,(RW2 d, IMM i))
MIDFUNC(3,call_r_02,(RR4 r, RR4 in1, RR4 in2))
{
clobber_flags();
in1 = readreg_specific(in1, REG_PAR1);
in2 = readreg_specific(in2, REG_PAR2);
r = readreg(r);
prepare_for_call_1();
unlock2(r);
unlock2(in1);
unlock2(in2);
prepare_for_call_2();
compemu_raw_call_r(r);
}
MENDFUNC(3,call_r_02,(RR4 r, RR4 in1, RR4 in2))
MIDFUNC(3,call_r_11,(W4 out1, RR4 r, RR4 in1))
{
clobber_flags();
if (out1 != in1 && out1 != r) {
COMPCALL(forget_about)(out1);
}
in1 = readreg_specific(in1, REG_PAR1);
r = readreg(r);
prepare_for_call_1();
unlock2(in1);
unlock2(r);
prepare_for_call_2();
compemu_raw_call_r(r);
live.nat[REG_RESULT].holds[0] = out1;
live.nat[REG_RESULT].nholds = 1;
live.nat[REG_RESULT].touched = touchcnt++;
live.state[out1].realreg = REG_RESULT;
live.state[out1].realind = 0;
live.state[out1].val = 0;
live.state[out1].validsize = 4;
set_status(out1, DIRTY);
}
MENDFUNC(3,call_r_11,(W4 out1, RR4 r, RR4 in1))
/* forget_about() takes a mid-layer register */ /* forget_about() takes a mid-layer register */
MIDFUNC(1,forget_about,(W4 r)) MIDFUNC(1,forget_about,(W4 r))

View file

@ -38,10 +38,8 @@ DECLARE_MIDFUNC(arm_ADD_l_ri8(RW4 d, IMM i));
DECLARE_MIDFUNC(arm_SUB_l_ri8(RW4 d, IMM i)); DECLARE_MIDFUNC(arm_SUB_l_ri8(RW4 d, IMM i));
// Emulated midfunc // Emulated midfunc
DECLARE_MIDFUNC(disp_ea20_target_add(RW4 target, RR4 reg, IMM shift, IMM extend));
DECLARE_MIDFUNC(disp_ea20_target_mov(W4 target, RR4 reg, IMM shift, IMM extend));
DECLARE_MIDFUNC(mov_l_mi(IMM d, IMM s)); DECLARE_MIDFUNC(mov_l_mi(IMM d, IMM s));
DECLARE_MIDFUNC(shll_l_ri(RW4 r, IMM i));
DECLARE_MIDFUNC(pop_l(W4 d)); DECLARE_MIDFUNC(pop_l(W4 d));
DECLARE_MIDFUNC(push_l(RR4 s)); DECLARE_MIDFUNC(push_l(RR4 s));
DECLARE_MIDFUNC(sign_extend_16_rr(W4 d, RR2 s)); DECLARE_MIDFUNC(sign_extend_16_rr(W4 d, RR2 s));
@ -56,6 +54,8 @@ DECLARE_MIDFUNC(mov_l_ri(W4 d, IMM s));
DECLARE_MIDFUNC(mov_b_ri(W1 d, IMM s)); DECLARE_MIDFUNC(mov_b_ri(W1 d, IMM s));
DECLARE_MIDFUNC(sub_l_ri(RW4 d, IMM i)); DECLARE_MIDFUNC(sub_l_ri(RW4 d, IMM i));
DECLARE_MIDFUNC(sub_w_ri(RW2 d, IMM i)); DECLARE_MIDFUNC(sub_w_ri(RW2 d, IMM i));
DECLARE_MIDFUNC(call_r_02(RR4 r, RR4 in1, RR4 in2));
DECLARE_MIDFUNC(call_r_11(W4 out1, RR4 r, RR4 in1));
DECLARE_MIDFUNC(live_flags(void)); DECLARE_MIDFUNC(live_flags(void));
DECLARE_MIDFUNC(dont_care_flags(void)); DECLARE_MIDFUNC(dont_care_flags(void));
DECLARE_MIDFUNC(make_flags_live(void)); DECLARE_MIDFUNC(make_flags_live(void));

View file

@ -4064,8 +4064,11 @@ MIDFUNC(2,jnf_MOVE16,(RR4 d, RR4 s))
BIC_rri(s, s, 0x0000000F); BIC_rri(s, s, 0x0000000F);
BIC_rri(d, d, 0x0000000F); BIC_rri(d, d, 0x0000000F);
ADD_rrr(s, s, R_MEMSTART); uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
ADD_rrr(d, d, R_MEMSTART); LDR_rRI(REG_WORK1, R_REGSTRUCT, offs);
ADD_rrr(s, s, REG_WORK1);
ADD_rrr(d, d, REG_WORK1);
#ifdef ARMV6T2 #ifdef ARMV6T2
LDRD_rR(REG_WORK1, s); LDRD_rR(REG_WORK1, s);
@ -5588,11 +5591,10 @@ MIDFUNC(2,jff_ROXL_b,(RW1 d, RR4 i))
CMP_ri(REG_WORK1, 8); CMP_ri(REG_WORK1, 8);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 9); CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 9);
TST_rr(REG_WORK1, REG_WORK1); TST_rr(REG_WORK1, REG_WORK1);
BNE_i(3); // need to rotate BNE_i(2); // need to rotate
MSR_CPSRf_i(0); MSR_CPSRf_i(0);
AND_rri(REG_WORK1, d, 0xff); // make sure to clear carry MOVS_rrLSLi(REG_WORK1, d, 24);
MOVS_rrLSLi(REG_WORK1, REG_WORK1, 24);
#ifdef ARMV6T2 #ifdef ARMV6T2
B_i(13); // end of op B_i(13); // end of op
#else #else
@ -5654,8 +5656,7 @@ MIDFUNC(2,jff_ROXL_w,(RW2 d, RR4 i))
BNE_i(3); // need to rotate BNE_i(3); // need to rotate
MSR_CPSRf_i(0); MSR_CPSRf_i(0);
BIC_rri(REG_WORK1, d, 0x00ff0000); // make sure to clear carry MOVS_rrLSLi(REG_WORK1, d, 16);
MOVS_rrLSLi(REG_WORK1, REG_WORK1, 16);
#ifdef ARMV6T2 #ifdef ARMV6T2
B_i(13); // end of op B_i(13); // end of op
#else #else
@ -6036,282 +6037,6 @@ MIDFUNC(1,jff_RORW,(RW2 d))
} }
MENDFUNC(1,jff_RORW,(RW2 d)) MENDFUNC(1,jff_RORW,(RW2 d))
/*
* ROXR
* Operand Syntax: Dx, Dy
* #<data>, Dy
*
* Operand Size: 8,16,32
*
* X Set according to the last bit rotated out of the operand. Unchanged when the rotate count is zero.
* N Set if the most significant bit of the result is set. Cleared otherwise.
* Z Set if the result is zero. Cleared otherwise.
* V Always cleared.
* C Set according to the last bit rotated out of the operand. Cleared when the rotate count is zero.
*
*/
MIDFUNC(2,jnf_ROXR_b,(RW1 d, RR4 i))
{
int x = readreg(FLAGX);
INIT_REGS_b(d, i);
clobber_flags();
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 35);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 36);
CMP_ri(REG_WORK1, 17);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 18);
CMP_ri(REG_WORK1, 8);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 9);
TST_rr(REG_WORK1, REG_WORK1);
#ifdef ARMV6T2
BEQ_i(4); // end of op
#else
BEQ_i(6); // end of op
#endif
// need to rotate
AND_rri(REG_WORK2, d, 0xff); // val = val & 0xff
ORR_rrrLSLi(REG_WORK2, REG_WORK2, REG_WORK2, 9); // val = val | (val << 9)
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 8); // val = val | (x << 8)
MOV_rrLSRr(REG_WORK2, REG_WORK2, REG_WORK1); // val = val >> cnt
#ifdef ARMV6T2
BFI_rrii(d, REG_WORK2, 0, 7);
#else
AND_rri(REG_WORK2, REG_WORK2, 0xff);
BIC_rri(d, d, 0xff);
ORR_rrr(d, d, REG_WORK2);
#endif
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jnf_ROXR_b,(RW1 d, RR4 i))
MIDFUNC(2,jnf_ROXR_w,(RW2 d, RR4 i))
{
int x = readreg(FLAGX);
INIT_REGS_w(d, i);
clobber_flags();
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 33);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 34);
CMP_ri(REG_WORK1, 16);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 17);
TST_rr(REG_WORK1, REG_WORK1);
BEQ_i(5); // end of op
// need to rotate
BIC_rri(REG_WORK2, d, 0xff000000);
BIC_rri(REG_WORK2, REG_WORK2, 0x00ff0000); // val = val & 0xffff
ORR_rrrLSLi(REG_WORK2, REG_WORK2, REG_WORK2, 17); // val = val | (val << 17)
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 16); // val = val | (x << 16)
MOV_rrLSRr(REG_WORK2, REG_WORK2, REG_WORK1); // val = val >> cnt
PKHTB_rrr(d, d, REG_WORK2);
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jnf_ROXR_w,(RW2 d, RR4 i))
MIDFUNC(2,jnf_ROXR_l,(RW4 d, RR4 i))
{
int x = readreg(FLAGX);
INIT_REGS_l(d, i);
clobber_flags();
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 32);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 33);
TST_rr(REG_WORK1, REG_WORK1);
BEQ_i(6); // end of op
// need to rotate
CMP_ri(REG_WORK1, 32);
CC_MOV_rrLSRr(NATIVE_CC_NE, REG_WORK2, d, REG_WORK1);
CC_MOV_ri(NATIVE_CC_EQ, REG_WORK2, 0);
RSB_rri(REG_WORK3, REG_WORK1, 32);
ORR_rrrLSLr(REG_WORK2, REG_WORK2, x, REG_WORK3);
ADD_rri(REG_WORK3, REG_WORK1, 1);
ORR_rrrLSLr(d, REG_WORK2, d, REG_WORK3);
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jnf_ROXR_l,(RW4 d, RR4 i))
MIDFUNC(2,jff_ROXR_b,(RW1 d, RR4 i))
{
INIT_REGS_b(d, i);
int x = rmw(FLAGX);
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 35);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 36);
CMP_ri(REG_WORK1, 17);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 18);
CMP_ri(REG_WORK1, 8);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 9);
TST_rr(REG_WORK1, REG_WORK1);
BNE_i(3); // need to rotate
MSR_CPSRf_i(0);
BIC_rri(REG_WORK1, d, 0x0000ff00); // make sure to clear carry
MOVS_rrLSLi(REG_WORK1, REG_WORK1, 24);
#ifdef ARMV6T2
B_i(9); // end of op
#else
B_i(12); // end of op
#endif
// need to rotate
AND_rri(REG_WORK2, d, 0xff); // val = val & 0xff
ORR_rrrLSLi(REG_WORK2, REG_WORK2, REG_WORK2, 9); // val = val | (val << 9)
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 8); // val = val | (x << 8)
MSR_CPSRf_i(0);
MOVS_rrLSRr(REG_WORK2, REG_WORK2, REG_WORK1); // val = val >> cnt
// Duplicate carry
MOV_ri(x, 1);
CC_MOV_ri(NATIVE_CC_CC, x, 0);
// Calc N and Z
#ifdef ARMV6T2
BFI_rrii(REG_WORK2, x, 8, 8); // Make sure to set carry (last bit shifted out)
#else
BIC_rri(REG_WORK2, REG_WORK2, 0x100);
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 8);
#endif
LSLS_rri(REG_WORK1, REG_WORK2, 24);
#ifdef ARMV6T2
BFI_rrii(d, REG_WORK2, 0, 7);
#else
AND_rri(REG_WORK2, REG_WORK2, 0xff);
BIC_rri(d, d, 0xff);
ORR_rrr(d, d, REG_WORK2);
#endif
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jff_ROXR_b,(RW1 d, RR4 i))
MIDFUNC(2,jff_ROXR_w,(RW2 d, RR4 i))
{
INIT_REGS_w(d, i);
int x = rmw(FLAGX);
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 33);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 34);
CMP_ri(REG_WORK1, 16);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 17);
TST_rr(REG_WORK1, REG_WORK1);
BNE_i(3); // need to rotate
MSR_CPSRf_i(0);
BIC_rri(REG_WORK1, d, 0x00ff0000); // make sure to clear carry
MOVS_rrLSLi(REG_WORK1, REG_WORK1, 16);
#ifdef ARMV6T2
B_i(10); // end of op
#else
B_i(11); // end of op
#endif
// need to rotate
BIC_rri(REG_WORK2, d, 0xff000000);
BIC_rri(REG_WORK2, REG_WORK2, 0x00ff0000); // val = val & 0xffff
ORR_rrrLSLi(REG_WORK2, REG_WORK2, REG_WORK2, 17); // val = val | (val << 17)
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 16); // val = val | (x << 16)
MSR_CPSRf_i(0);
MOVS_rrLSRr(REG_WORK2, REG_WORK2, REG_WORK1); // val = val >> cnt
// Duplicate carry
MOV_ri(x, 1);
CC_MOV_ri(NATIVE_CC_CC, x, 0);
// Calc N and Z
#ifdef ARMV6T2
BFI_rrii(REG_WORK2, x, 16, 16); // Make sure to set carry (last bit shifted out)
#else
BIC_rri(REG_WORK2, REG_WORK2, 0x10000);
ORR_rrrLSLi(REG_WORK2, REG_WORK2, x, 16);
#endif
LSLS_rri(REG_WORK1, REG_WORK2, 16);
PKHTB_rrr(d, d, REG_WORK2);
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jff_ROXR_w,(RW2 d, RR4 i))
MIDFUNC(2,jff_ROXR_l,(RW4 d, RR4 i))
{
INIT_REGS_l(d, i);
int x = rmw(FLAGX);
AND_rri(REG_WORK1, i, 63);
CMP_ri(REG_WORK1, 32);
CC_SUB_rri(NATIVE_CC_GT, REG_WORK1, REG_WORK1, 33);
TST_rr(REG_WORK1, REG_WORK1);
BNE_i(2); // need to rotate
MSR_CPSRf_i(0);
TST_rr(d, d);
B_i(13); // end of op
// need to rotate
CMP_ri(REG_WORK1, 32);
BNE_i(3); // rotate 1-31
// rotate 32
MSR_CPSRf_i(0);
LSLS_rri(d, d, 1);
ORRS_rrr(d, d, x);
B_i(5); // duplicate carry
// rotate 1-31
MSR_CPSRf_i(0);
MOVS_rrLSRr(REG_WORK2, d, REG_WORK1);
RSB_rri(REG_WORK3, REG_WORK1, 32);
ORR_rrrLSLr(REG_WORK2, REG_WORK2, x, REG_WORK3);
ADD_rri(REG_WORK3, REG_WORK1, 1);
ORR_rrrLSLr(d, REG_WORK2, d, REG_WORK3);
// Duplicate carry
MOV_ri(x, 1);
CC_MOV_ri(NATIVE_CC_CC, x, 0);
// end of op
unlock2(x);
EXIT_REGS(d, i);
}
MENDFUNC(2,jff_ROXR_l,(RW4 d, RR4 i))
/* /*
* SCC * SCC
* *
@ -6929,10 +6654,13 @@ MENDFUNC(1,jff_TST_l,(RR4 s))
*/ */
MIDFUNC(2,jnf_MEM_WRITE_OFF_b,(RR4 adr, RR4 b)) MIDFUNC(2,jnf_MEM_WRITE_OFF_b,(RR4 adr, RR4 b))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
b = readreg(b); b = readreg(b);
STRB_rRR(b, adr, R_MEMSTART); STRB_rRR(b, adr, REG_WORK2);
unlock2(b); unlock2(b);
unlock2(adr); unlock2(adr);
@ -6941,11 +6669,14 @@ MENDFUNC(2,jnf_MEM_WRITE_OFF_b,(RR4 adr, RR4 b))
MIDFUNC(2,jnf_MEM_WRITE_OFF_w,(RR4 adr, RR4 w)) MIDFUNC(2,jnf_MEM_WRITE_OFF_w,(RR4 adr, RR4 w))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
w = readreg(w); w = readreg(w);
REV16_rr(REG_WORK1, w); REV16_rr(REG_WORK1, w);
STRH_rRR(REG_WORK1, adr, R_MEMSTART); STRH_rRR(REG_WORK1, adr, REG_WORK2);
unlock2(w); unlock2(w);
unlock2(adr); unlock2(adr);
@ -6954,11 +6685,14 @@ MENDFUNC(2,jnf_MEM_WRITE_OFF_w,(RR4 adr, RR4 w))
MIDFUNC(2,jnf_MEM_WRITE_OFF_l,(RR4 adr, RR4 l)) MIDFUNC(2,jnf_MEM_WRITE_OFF_l,(RR4 adr, RR4 l))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
l = readreg(l); l = readreg(l);
REV_rr(REG_WORK1, l); REV_rr(REG_WORK1, l);
STR_rRR(REG_WORK1, adr, R_MEMSTART); STR_rRR(REG_WORK1, adr, REG_WORK2);
unlock2(l); unlock2(l);
unlock2(adr); unlock2(adr);
@ -6968,10 +6702,13 @@ MENDFUNC(2,jnf_MEM_WRITE_OFF_l,(RR4 adr, RR4 l))
MIDFUNC(2,jnf_MEM_READ_OFF_b,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ_OFF_b,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
LDRB_rRR(d, adr, R_MEMSTART); LDRB_rRR(d, adr, REG_WORK2);
unlock2(d); unlock2(d);
unlock2(adr); unlock2(adr);
@ -6980,10 +6717,13 @@ MENDFUNC(2,jnf_MEM_READ_OFF_b,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_READ_OFF_w,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ_OFF_w,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
LDRH_rRR(REG_WORK1, adr, R_MEMSTART); LDRH_rRR(REG_WORK1, adr, REG_WORK2);
REV16_rr(d, REG_WORK1); REV16_rr(d, REG_WORK1);
unlock2(d); unlock2(d);
@ -6993,10 +6733,13 @@ MENDFUNC(2,jnf_MEM_READ_OFF_w,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_READ_OFF_l,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ_OFF_l,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
LDR_rRR(REG_WORK1, adr, R_MEMSTART); LDR_rRR(REG_WORK1, adr, REG_WORK2);
REV_rr(d, REG_WORK1); REV_rr(d, REG_WORK1);
unlock2(d); unlock2(d);
@ -7007,11 +6750,14 @@ MENDFUNC(2,jnf_MEM_READ_OFF_l,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_WRITE24_OFF_b,(RR4 adr, RR4 b)) MIDFUNC(2,jnf_MEM_WRITE24_OFF_b,(RR4 adr, RR4 b))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
b = readreg(b); b = readreg(b);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
STRB_rRR(b, REG_WORK1, R_MEMSTART); STRB_rRR(b, REG_WORK1, REG_WORK2);
unlock2(b); unlock2(b);
unlock2(adr); unlock2(adr);
@ -7020,12 +6766,15 @@ MENDFUNC(2,jnf_MEM_WRITE24_OFF_b,(RR4 adr, RR4 b))
MIDFUNC(2,jnf_MEM_WRITE24_OFF_w,(RR4 adr, RR4 w)) MIDFUNC(2,jnf_MEM_WRITE24_OFF_w,(RR4 adr, RR4 w))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
w = readreg(w); w = readreg(w);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
REV16_rr(REG_WORK3, w); REV16_rr(REG_WORK3, w);
STRH_rRR(REG_WORK3, REG_WORK1, R_MEMSTART); STRH_rRR(REG_WORK3, REG_WORK1, REG_WORK2);
unlock2(w); unlock2(w);
unlock2(adr); unlock2(adr);
@ -7034,12 +6783,15 @@ MENDFUNC(2,jnf_MEM_WRITE24_OFF_w,(RR4 adr, RR4 w))
MIDFUNC(2,jnf_MEM_WRITE24_OFF_l,(RR4 adr, RR4 l)) MIDFUNC(2,jnf_MEM_WRITE24_OFF_l,(RR4 adr, RR4 l))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
l = readreg(l); l = readreg(l);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
REV_rr(REG_WORK3, l); REV_rr(REG_WORK3, l);
STR_rRR(REG_WORK3, REG_WORK1, R_MEMSTART); STR_rRR(REG_WORK3, REG_WORK1, REG_WORK2);
unlock2(l); unlock2(l);
unlock2(adr); unlock2(adr);
@ -7049,11 +6801,14 @@ MENDFUNC(2,jnf_MEM_WRITE24_OFF_l,(RR4 adr, RR4 l))
MIDFUNC(2,jnf_MEM_READ24_OFF_b,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ24_OFF_b,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
LDRB_rRR(d, REG_WORK1, R_MEMSTART); LDRB_rRR(d, REG_WORK1, REG_WORK2);
unlock2(d); unlock2(d);
unlock2(adr); unlock2(adr);
@ -7062,11 +6817,14 @@ MENDFUNC(2,jnf_MEM_READ24_OFF_b,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_READ24_OFF_w,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ24_OFF_w,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
LDRH_rRR(REG_WORK1, REG_WORK1, R_MEMSTART); LDRH_rRR(REG_WORK1, REG_WORK1, REG_WORK2);
REV16_rr(d, REG_WORK1); REV16_rr(d, REG_WORK1);
unlock2(d); unlock2(d);
@ -7076,11 +6834,14 @@ MENDFUNC(2,jnf_MEM_READ24_OFF_w,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_READ24_OFF_l,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_READ24_OFF_l,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
LDR_rRR(d, REG_WORK1, R_MEMSTART); LDR_rRR(d, REG_WORK1, REG_WORK2);
REV_rr(d, d); REV_rr(d, d);
unlock2(d); unlock2(d);
@ -7091,10 +6852,13 @@ MENDFUNC(2,jnf_MEM_READ24_OFF_l,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_GETADR_OFF,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_GETADR_OFF,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
ADD_rrr(d, adr, R_MEMSTART); ADD_rrr(d, adr, REG_WORK2);
unlock2(d); unlock2(d);
unlock2(adr); unlock2(adr);
@ -7103,11 +6867,14 @@ MENDFUNC(2,jnf_MEM_GETADR_OFF,(W4 d, RR4 adr))
MIDFUNC(2,jnf_MEM_GETADR24_OFF,(W4 d, RR4 adr)) MIDFUNC(2,jnf_MEM_GETADR24_OFF,(W4 d, RR4 adr))
{ {
uae_s32 offs = (uae_u32)&NATMEM_OFFSETX - (uae_u32) &regs;
LDR_rRI(REG_WORK2, R_REGSTRUCT, offs);
adr = readreg(adr); adr = readreg(adr);
d = writereg(d); d = writereg(d);
BIC_rri(REG_WORK1, adr, 0xff000000); BIC_rri(REG_WORK1, adr, 0xff000000);
ADD_rrr(d, REG_WORK1, R_MEMSTART); ADD_rrr(d, REG_WORK1, REG_WORK2);
unlock2(d); unlock2(d);
unlock2(adr); unlock2(adr);
@ -7115,17 +6882,10 @@ MIDFUNC(2,jnf_MEM_GETADR24_OFF,(W4 d, RR4 adr))
MENDFUNC(2,jnf_MEM_GETADR24_OFF,(W4 d, RR4 adr)) MENDFUNC(2,jnf_MEM_GETADR24_OFF,(W4 d, RR4 adr))
MIDFUNC(3,jnf_MEM_READMEMBANK,(W4 dest, RR4 adr, IMM offset)) MIDFUNC(2,jnf_MEM_GETBANKFUNC,(W4 d, RR4 adr, IMM offset))
{ {
clobber_flags(); adr = readreg(adr);
if (dest != adr) { d = writereg(d);
COMPCALL(forget_about)(dest);
}
adr = readreg_specific(adr, REG_PAR1);
prepare_for_call_1();
unlock2(adr);
prepare_for_call_2();
#ifdef ARMV6T2 #ifdef ARMV6T2
MOVW_ri16(REG_WORK2, (uae_u32)mem_banks); MOVW_ri16(REG_WORK2, (uae_u32)mem_banks);
@ -7135,47 +6895,10 @@ MIDFUNC(3,jnf_MEM_READMEMBANK,(W4 dest, RR4 adr, IMM offset))
LDR_rRI(REG_WORK2, RPC_INDEX, offs); LDR_rRI(REG_WORK2, RPC_INDEX, offs);
#endif #endif
LSR_rri(REG_WORK1, adr, 16); LSR_rri(REG_WORK1, adr, 16);
LDR_rRR_LSLi(REG_WORK3, REG_WORK2, REG_WORK1, 2); LDR_rRR_LSLi(d, REG_WORK2, REG_WORK1, 2);
LDR_rRI(REG_WORK3, REG_WORK3, offset); LDR_rRI(d, d, offset);
compemu_raw_call_r(REG_WORK3); unlock2(d);
live.nat[REG_RESULT].holds[0] = dest;
live.nat[REG_RESULT].nholds = 1;
live.nat[REG_RESULT].touched = touchcnt++;
live.state[dest].realreg = REG_RESULT;
live.state[dest].realind = 0;
live.state[dest].val = 0;
live.state[dest].validsize = 4;
set_status(dest, DIRTY);
}
MENDFUNC(3,jnf_MEM_READMEMBANK,(W4 dest, RR4 adr, IMM offset))
MIDFUNC(3,jnf_MEM_WRITEMEMBANK,(RR4 adr, RR4 source, IMM offset))
{
clobber_flags();
adr = readreg_specific(adr, REG_PAR1);
source = readreg_specific(source, REG_PAR2);
prepare_for_call_1();
unlock2(adr); unlock2(adr);
unlock2(source);
prepare_for_call_2();
#ifdef ARMV6T2
MOVW_ri16(REG_WORK2, (uae_u32)mem_banks);
MOVT_ri16(REG_WORK2, (uae_u32)mem_banks >> 16);
#else
uae_s32 offs = data_long_offs((uae_u32)mem_banks);
LDR_rRI(REG_WORK2, RPC_INDEX, offs);
#endif
LSR_rri(REG_WORK1, adr, 16);
LDR_rRR_LSLi(REG_WORK3, REG_WORK2, REG_WORK1, 2);
LDR_rRI(REG_WORK3, REG_WORK3, offset);
compemu_raw_call_r(REG_WORK3);
} }
MENDFUNC(3,jnf_MEM_WRITEMEMBANK,(RR4 adr, RR4 source, IMM offset)) MENDFUNC(2,jnf_MEM_GETBANKFUNC,(W4 d, RR4 adr, IMM offset))

View file

@ -357,14 +357,6 @@ DECLARE_MIDFUNC(jff_ROR_b(RW1 d, RR4 i));
DECLARE_MIDFUNC(jff_ROR_w(RW2 d, RR4 i)); DECLARE_MIDFUNC(jff_ROR_w(RW2 d, RR4 i));
DECLARE_MIDFUNC(jff_ROR_l(RW4 d, RR4 i)); DECLARE_MIDFUNC(jff_ROR_l(RW4 d, RR4 i));
// ROXR
DECLARE_MIDFUNC(jnf_ROXR_b(RW1 d, RR4 i));
DECLARE_MIDFUNC(jnf_ROXR_w(RW2 d, RR4 i));
DECLARE_MIDFUNC(jnf_ROXR_l(RW4 d, RR4 i));
DECLARE_MIDFUNC(jff_ROXR_b(RW1 d, RR4 i));
DECLARE_MIDFUNC(jff_ROXR_w(RW2 d, RR4 i));
DECLARE_MIDFUNC(jff_ROXR_l(RW4 d, RR4 i));
// Scc // Scc
DECLARE_MIDFUNC(jnf_SCC(W1 d, IMM cc)); DECLARE_MIDFUNC(jnf_SCC(W1 d, IMM cc));
@ -420,6 +412,4 @@ DECLARE_MIDFUNC(jnf_MEM_READ24_OFF_l(W4 d, RR4 adr));
DECLARE_MIDFUNC(jnf_MEM_GETADR_OFF(W4 d, RR4 adr)); DECLARE_MIDFUNC(jnf_MEM_GETADR_OFF(W4 d, RR4 adr));
DECLARE_MIDFUNC(jnf_MEM_GETADR24_OFF(W4 d, RR4 adr)); DECLARE_MIDFUNC(jnf_MEM_GETADR24_OFF(W4 d, RR4 adr));
DECLARE_MIDFUNC(jnf_MEM_GETBANKFUNC(W4 d, RR4 adr, IMM offset));
DECLARE_MIDFUNC(jnf_MEM_READMEMBANK(W4 dest, RR4 adr, IMM offset));
DECLARE_MIDFUNC(jnf_MEM_WRITEMEMBANK(RR4 adr, RR4 source, IMM offset));

View file

@ -1544,7 +1544,7 @@ void freescratch(void)
int i; int i;
for (i=0; i<N_REGS; i++) for (i=0; i<N_REGS; i++)
#if defined(CPU_arm) #if defined(CPU_arm)
if (live.nat[i].locked && i != 2 && i != 3 && i != 10 && i != 11 && i != 12) { if (live.nat[i].locked && i != 2 && i != 3 && i != 11 && i != 12) {
#else #else
if (live.nat[i].locked && i!=4 && i!= 12) { if (live.nat[i].locked && i!=4 && i!= 12) {
#endif #endif
@ -1663,52 +1663,74 @@ static void writemem_real(int address, int source, int size)
} }
} }
STATIC_INLINE void writemem_special(int address, int source, int offset) STATIC_INLINE void writemem_special(int address, int source, int offset, int tmp)
{ {
jnf_MEM_WRITEMEMBANK(address, source, offset); jnf_MEM_GETBANKFUNC(tmp, address, offset);
/* Now tmp holds the address of the b/w/lput function */
call_r_02(tmp, address, source);
forget_about(tmp);
} }
void writebyte(int address, int source) void writebyte(int address, int source, int tmp)
{ {
if (special_mem & S_WRITE) if (special_mem & S_WRITE)
writemem_special(address, source, 20); writemem_special(address, source, 20, tmp);
else else
writemem_real(address, source, 1); writemem_real(address, source, 1);
} }
void writeword(int address, int source) void writeword(int address, int source, int tmp)
{ {
if (special_mem & S_WRITE) if (special_mem & S_WRITE)
writemem_special(address, source, 16); writemem_special(address, source, 16, tmp);
else else
writemem_real(address, source, 2); writemem_real(address, source, 2);
} }
void writelong(int address, int source) void writelong(int address, int source, int tmp)
{ {
if (special_mem & S_WRITE) if (special_mem & S_WRITE)
writemem_special(address, source, 12); writemem_special(address, source, 12, tmp);
else else
writemem_real(address, source, 4); writemem_real(address, source, 4);
} }
// Now the same for clobber variant // Now the same for clobber variant
void writeword_clobber(int address, int source) STATIC_INLINE void writemem_real_clobber(int address, int source, int size)
{ {
if (special_mem & S_WRITE) if(currprefs.address_space_24)
writemem_special(address, source, 16); {
switch(size) {
case 1: jnf_MEM_WRITE24_OFF_b(address, source); break;
case 2: jnf_MEM_WRITE24_OFF_w(address, source); break;
case 4: jnf_MEM_WRITE24_OFF_l(address, source); break;
}
}
else else
writemem_real(address, source, 2); {
switch(size) {
case 1: jnf_MEM_WRITE_OFF_b(address, source); break;
case 2: jnf_MEM_WRITE_OFF_w(address, source); break;
case 4: jnf_MEM_WRITE_OFF_l(address, source); break;
}
}
forget_about(source); forget_about(source);
} }
void writelong_clobber(int address, int source) void writeword_clobber(int address, int source, int tmp)
{ {
if (special_mem & S_WRITE) if (special_mem & S_WRITE)
writemem_special(address, source, 12); writemem_special(address, source, 16, tmp);
else else
writemem_real(address, source, 4); writemem_real_clobber(address, source, 2);
forget_about(source); }
void writelong_clobber(int address, int source, int tmp)
{
if (special_mem & S_WRITE)
writemem_special(address, source, 12, tmp);
else
writemem_real_clobber(address, source, 4);
} }
@ -1736,39 +1758,42 @@ static void readmem_real(int address, int dest, int size)
} }
} }
STATIC_INLINE void readmem_special(int address, int dest, int offset) STATIC_INLINE void readmem_special(int address, int dest, int offset, int tmp)
{ {
jnf_MEM_READMEMBANK(dest, address, offset); jnf_MEM_GETBANKFUNC(tmp, address, offset);
/* Now tmp holds the address of the b/w/lget function */
call_r_11(dest, tmp, address);
forget_about(tmp);
} }
void readbyte(int address, int dest) void readbyte(int address, int dest, int tmp)
{ {
if (special_mem & S_READ) if (special_mem & S_READ)
readmem_special(address, dest, 8); readmem_special(address, dest, 8, tmp);
else else
readmem_real(address, dest, 1); readmem_real(address, dest, 1);
} }
void readword(int address, int dest) void readword(int address, int dest, int tmp)
{ {
if (special_mem & S_READ) if (special_mem & S_READ)
readmem_special(address, dest, 4); readmem_special(address, dest, 4, tmp);
else else
readmem_real(address, dest, 2); readmem_real(address, dest, 2);
} }
void readlong(int address, int dest) void readlong(int address, int dest, int tmp)
{ {
if (special_mem & S_READ) if (special_mem & S_READ)
readmem_special(address, dest, 0); readmem_special(address, dest, 0, tmp);
else else
readmem_real(address, dest, 4); readmem_real(address, dest, 4);
} }
/* This one might appear a bit odd... */ /* This one might appear a bit odd... */
STATIC_INLINE void get_n_addr_old(int address, int dest) STATIC_INLINE void get_n_addr_old(int address, int dest, int tmp)
{ {
readmem_special(address, dest, 24); readmem_special(address, dest, 24, tmp);
} }
STATIC_INLINE void get_n_addr_real(int address, int dest) STATIC_INLINE void get_n_addr_real(int address, int dest)
@ -1779,27 +1804,27 @@ STATIC_INLINE void get_n_addr_real(int address, int dest)
jnf_MEM_GETADR_OFF(dest, address); jnf_MEM_GETADR_OFF(dest, address);
} }
void get_n_addr(int address, int dest) void get_n_addr(int address, int dest, int tmp)
{ {
if (special_mem) if (special_mem)
get_n_addr_old(address, dest); get_n_addr_old(address,dest,tmp);
else else
get_n_addr_real(address,dest); get_n_addr_real(address,dest);
} }
void get_n_addr_jmp(int address, int dest) void get_n_addr_jmp(int address, int dest, int tmp)
{ {
/* For this, we need to get the same address as the rest of UAE /* For this, we need to get the same address as the rest of UAE
would --- otherwise we end up translating everything twice */ would --- otherwise we end up translating everything twice */
if (special_mem) if (special_mem)
get_n_addr_old(address, dest); get_n_addr_old(address,dest,tmp);
else else
get_n_addr_real(address,dest); get_n_addr_real(address,dest);
} }
/* base is a register, but dp is an actual value. /* base is a register, but dp is an actual value.
target is a register */ target is a register, as is tmp */
void calc_disp_ea_020(int base, uae_u32 dp, int target) void calc_disp_ea_020(int base, uae_u32 dp, int target, int tmp)
{ {
int reg = (dp >> 12) & 15; int reg = (dp >> 12) & 15;
int regd_shift=(dp >> 9) & 3; int regd_shift=(dp >> 9) & 3;
@ -1818,7 +1843,11 @@ void calc_disp_ea_020(int base, uae_u32 dp, int target)
if ((dp & 0x4) == 0) { /* add regd *before* the get_long */ if ((dp & 0x4) == 0) { /* add regd *before* the get_long */
if (!ignorereg) { if (!ignorereg) {
disp_ea20_target_mov(target, reg, regd_shift, ((dp & 0x800) == 0)); if ((dp & 0x800) == 0)
sign_extend_16_rr(target, reg);
else
mov_l_rr(target, reg);
shll_l_ri(target, regd_shift);
} }
else else
mov_l_ri(target, 0); mov_l_ri(target, 0);
@ -1827,7 +1856,7 @@ void calc_disp_ea_020(int base, uae_u32 dp, int target)
if (!ignorebase) if (!ignorebase)
arm_ADD_l(target, base); arm_ADD_l(target, base);
arm_ADD_l_ri(target, addbase); arm_ADD_l_ri(target, addbase);
if (dp&0x03) readlong(target, target); if (dp&0x03) readlong(target, target, tmp);
} else { /* do the getlong first, then add regd */ } else { /* do the getlong first, then add regd */
if (!ignorebase) { if (!ignorebase) {
mov_l_rr(target, base); mov_l_rr(target, base);
@ -1835,10 +1864,16 @@ void calc_disp_ea_020(int base, uae_u32 dp, int target)
} }
else else
mov_l_ri(target, addbase); mov_l_ri(target, addbase);
if (dp&0x03) readlong(target, target); if (dp&0x03) readlong(target, target, tmp);
if (!ignorereg) { if (!ignorereg) {
disp_ea20_target_add(target, reg, regd_shift, ((dp & 0x800) == 0)); if ((dp & 0x800) == 0)
sign_extend_16_rr(tmp, reg);
else
mov_l_rr(tmp, reg);
shll_l_ri(tmp, regd_shift);
/* tmp is now regd */
arm_ADD_l(target, tmp);
} }
} }
arm_ADD_l_ri(target, outer); arm_ADD_l_ri(target, outer);
@ -1852,6 +1887,7 @@ void calc_disp_ea_020(int base, uae_u32 dp, int target)
lea_l_brr_indexed(target, base, reg, 1 << regd_shift, (uae_s8)dp); lea_l_brr_indexed(target, base, reg, 1 << regd_shift, (uae_s8)dp);
} }
} }
forget_about(tmp);
} }
void set_cache_state(int enabled) void set_cache_state(int enabled)
@ -1991,6 +2027,7 @@ STATIC_INLINE int block_check_checksum(blockinfo* bi)
means we have to move it into the needs-to-be-flushed list */ means we have to move it into the needs-to-be-flushed list */
bi->handler_to_use = bi->handler; bi->handler_to_use = bi->handler;
set_dhtu(bi, bi->direct_handler); set_dhtu(bi, bi->direct_handler);
bi->status = BI_CHECKING; bi->status = BI_CHECKING;
isgood = called_check_checksum(bi) != 0; isgood = called_check_checksum(bi) != 0;
} }

View file

@ -1636,27 +1636,27 @@ extern const struct comptbl op_smalltbl_0_comp_ff[] = {
{ op_d1fc_0_comp_ff, 0x00000002, 53756 }, /* ADDA */ { op_d1fc_0_comp_ff, 0x00000002, 53756 }, /* ADDA */
{ op_e000_0_comp_ff, 0x00000000, 57344 }, /* ASR */ { op_e000_0_comp_ff, 0x00000000, 57344 }, /* ASR */
{ op_e008_0_comp_ff, 0x00000000, 57352 }, /* LSR */ { op_e008_0_comp_ff, 0x00000000, 57352 }, /* LSR */
{ op_e010_0_comp_ff, 0x00000008, 57360 }, /* ROXR */ { NULL, 0x00000008, 57360 }, /* ROXR */
{ op_e018_0_comp_ff, 0x00000000, 57368 }, /* ROR */ { op_e018_0_comp_ff, 0x00000000, 57368 }, /* ROR */
{ op_e020_0_comp_ff, 0x00000000, 57376 }, /* ASR */ { op_e020_0_comp_ff, 0x00000000, 57376 }, /* ASR */
{ op_e028_0_comp_ff, 0x00000000, 57384 }, /* LSR */ { op_e028_0_comp_ff, 0x00000000, 57384 }, /* LSR */
{ op_e030_0_comp_ff, 0x00000008, 57392 }, /* ROXR */ { NULL, 0x00000008, 57392 }, /* ROXR */
{ op_e038_0_comp_ff, 0x00000000, 57400 }, /* ROR */ { op_e038_0_comp_ff, 0x00000000, 57400 }, /* ROR */
{ op_e040_0_comp_ff, 0x00000000, 57408 }, /* ASR */ { op_e040_0_comp_ff, 0x00000000, 57408 }, /* ASR */
{ op_e048_0_comp_ff, 0x00000000, 57416 }, /* LSR */ { op_e048_0_comp_ff, 0x00000000, 57416 }, /* LSR */
{ op_e050_0_comp_ff, 0x00000008, 57424 }, /* ROXR */ { NULL, 0x00000008, 57424 }, /* ROXR */
{ op_e058_0_comp_ff, 0x00000000, 57432 }, /* ROR */ { op_e058_0_comp_ff, 0x00000000, 57432 }, /* ROR */
{ op_e060_0_comp_ff, 0x00000000, 57440 }, /* ASR */ { op_e060_0_comp_ff, 0x00000000, 57440 }, /* ASR */
{ op_e068_0_comp_ff, 0x00000000, 57448 }, /* LSR */ { op_e068_0_comp_ff, 0x00000000, 57448 }, /* LSR */
{ op_e070_0_comp_ff, 0x00000008, 57456 }, /* ROXR */ { NULL, 0x00000008, 57456 }, /* ROXR */
{ op_e078_0_comp_ff, 0x00000000, 57464 }, /* ROR */ { op_e078_0_comp_ff, 0x00000000, 57464 }, /* ROR */
{ op_e080_0_comp_ff, 0x00000000, 57472 }, /* ASR */ { op_e080_0_comp_ff, 0x00000000, 57472 }, /* ASR */
{ op_e088_0_comp_ff, 0x00000000, 57480 }, /* LSR */ { op_e088_0_comp_ff, 0x00000000, 57480 }, /* LSR */
{ op_e090_0_comp_ff, 0x00000008, 57488 }, /* ROXR */ { NULL, 0x00000008, 57488 }, /* ROXR */
{ op_e098_0_comp_ff, 0x00000000, 57496 }, /* ROR */ { op_e098_0_comp_ff, 0x00000000, 57496 }, /* ROR */
{ op_e0a0_0_comp_ff, 0x00000000, 57504 }, /* ASR */ { op_e0a0_0_comp_ff, 0x00000000, 57504 }, /* ASR */
{ op_e0a8_0_comp_ff, 0x00000000, 57512 }, /* LSR */ { op_e0a8_0_comp_ff, 0x00000000, 57512 }, /* LSR */
{ op_e0b0_0_comp_ff, 0x00000008, 57520 }, /* ROXR */ { NULL, 0x00000008, 57520 }, /* ROXR */
{ op_e0b8_0_comp_ff, 0x00000000, 57528 }, /* ROR */ { op_e0b8_0_comp_ff, 0x00000000, 57528 }, /* ROR */
{ op_e0d0_0_comp_ff, 0x00000000, 57552 }, /* ASRW */ { op_e0d0_0_comp_ff, 0x00000000, 57552 }, /* ASRW */
{ op_e0d8_0_comp_ff, 0x00000000, 57560 }, /* ASRW */ { op_e0d8_0_comp_ff, 0x00000000, 57560 }, /* ASRW */
@ -3508,27 +3508,27 @@ extern const struct comptbl op_smalltbl_0_comp_nf[] = {
{ op_d1fc_0_comp_nf, 0x00000002, 53756 }, /* ADDA */ { op_d1fc_0_comp_nf, 0x00000002, 53756 }, /* ADDA */
{ op_e000_0_comp_nf, 0x00000000, 57344 }, /* ASR */ { op_e000_0_comp_nf, 0x00000000, 57344 }, /* ASR */
{ op_e008_0_comp_nf, 0x00000000, 57352 }, /* LSR */ { op_e008_0_comp_nf, 0x00000000, 57352 }, /* LSR */
{ op_e010_0_comp_nf, 0x00000008, 57360 }, /* ROXR */ { NULL, 0x00000008, 57360 }, /* ROXR */
{ op_e018_0_comp_nf, 0x00000000, 57368 }, /* ROR */ { op_e018_0_comp_nf, 0x00000000, 57368 }, /* ROR */
{ op_e020_0_comp_nf, 0x00000000, 57376 }, /* ASR */ { op_e020_0_comp_nf, 0x00000000, 57376 }, /* ASR */
{ op_e028_0_comp_nf, 0x00000000, 57384 }, /* LSR */ { op_e028_0_comp_nf, 0x00000000, 57384 }, /* LSR */
{ op_e030_0_comp_nf, 0x00000008, 57392 }, /* ROXR */ { NULL, 0x00000008, 57392 }, /* ROXR */
{ op_e038_0_comp_nf, 0x00000000, 57400 }, /* ROR */ { op_e038_0_comp_nf, 0x00000000, 57400 }, /* ROR */
{ op_e040_0_comp_nf, 0x00000000, 57408 }, /* ASR */ { op_e040_0_comp_nf, 0x00000000, 57408 }, /* ASR */
{ op_e048_0_comp_nf, 0x00000000, 57416 }, /* LSR */ { op_e048_0_comp_nf, 0x00000000, 57416 }, /* LSR */
{ op_e050_0_comp_nf, 0x00000008, 57424 }, /* ROXR */ { NULL, 0x00000008, 57424 }, /* ROXR */
{ op_e058_0_comp_nf, 0x00000000, 57432 }, /* ROR */ { op_e058_0_comp_nf, 0x00000000, 57432 }, /* ROR */
{ op_e060_0_comp_nf, 0x00000000, 57440 }, /* ASR */ { op_e060_0_comp_nf, 0x00000000, 57440 }, /* ASR */
{ op_e068_0_comp_nf, 0x00000000, 57448 }, /* LSR */ { op_e068_0_comp_nf, 0x00000000, 57448 }, /* LSR */
{ op_e070_0_comp_nf, 0x00000008, 57456 }, /* ROXR */ { NULL, 0x00000008, 57456 }, /* ROXR */
{ op_e078_0_comp_nf, 0x00000000, 57464 }, /* ROR */ { op_e078_0_comp_nf, 0x00000000, 57464 }, /* ROR */
{ op_e080_0_comp_nf, 0x00000000, 57472 }, /* ASR */ { op_e080_0_comp_nf, 0x00000000, 57472 }, /* ASR */
{ op_e088_0_comp_nf, 0x00000000, 57480 }, /* LSR */ { op_e088_0_comp_nf, 0x00000000, 57480 }, /* LSR */
{ op_e090_0_comp_nf, 0x00000008, 57488 }, /* ROXR */ { NULL, 0x00000008, 57488 }, /* ROXR */
{ op_e098_0_comp_nf, 0x00000000, 57496 }, /* ROR */ { op_e098_0_comp_nf, 0x00000000, 57496 }, /* ROR */
{ op_e0a0_0_comp_nf, 0x00000000, 57504 }, /* ASR */ { op_e0a0_0_comp_nf, 0x00000000, 57504 }, /* ASR */
{ op_e0a8_0_comp_nf, 0x00000000, 57512 }, /* LSR */ { op_e0a8_0_comp_nf, 0x00000000, 57512 }, /* LSR */
{ op_e0b0_0_comp_nf, 0x00000008, 57520 }, /* ROXR */ { NULL, 0x00000008, 57520 }, /* ROXR */
{ op_e0b8_0_comp_nf, 0x00000000, 57528 }, /* ROR */ { op_e0b8_0_comp_nf, 0x00000000, 57528 }, /* ROR */
{ op_e0d0_0_comp_nf, 0x00000000, 57552 }, /* ASRW */ { op_e0d0_0_comp_nf, 0x00000000, 57552 }, /* ASRW */
{ op_e0d8_0_comp_nf, 0x00000000, 57560 }, /* ASRW */ { op_e0d8_0_comp_nf, 0x00000000, 57560 }, /* ASRW */

View file

@ -1399,27 +1399,21 @@ extern compop_func op_d1fb_0_comp_ff;
extern compop_func op_d1fc_0_comp_ff; extern compop_func op_d1fc_0_comp_ff;
extern compop_func op_e000_0_comp_ff; extern compop_func op_e000_0_comp_ff;
extern compop_func op_e008_0_comp_ff; extern compop_func op_e008_0_comp_ff;
extern compop_func op_e010_0_comp_ff;
extern compop_func op_e018_0_comp_ff; extern compop_func op_e018_0_comp_ff;
extern compop_func op_e020_0_comp_ff; extern compop_func op_e020_0_comp_ff;
extern compop_func op_e028_0_comp_ff; extern compop_func op_e028_0_comp_ff;
extern compop_func op_e030_0_comp_ff;
extern compop_func op_e038_0_comp_ff; extern compop_func op_e038_0_comp_ff;
extern compop_func op_e040_0_comp_ff; extern compop_func op_e040_0_comp_ff;
extern compop_func op_e048_0_comp_ff; extern compop_func op_e048_0_comp_ff;
extern compop_func op_e050_0_comp_ff;
extern compop_func op_e058_0_comp_ff; extern compop_func op_e058_0_comp_ff;
extern compop_func op_e060_0_comp_ff; extern compop_func op_e060_0_comp_ff;
extern compop_func op_e068_0_comp_ff; extern compop_func op_e068_0_comp_ff;
extern compop_func op_e070_0_comp_ff;
extern compop_func op_e078_0_comp_ff; extern compop_func op_e078_0_comp_ff;
extern compop_func op_e080_0_comp_ff; extern compop_func op_e080_0_comp_ff;
extern compop_func op_e088_0_comp_ff; extern compop_func op_e088_0_comp_ff;
extern compop_func op_e090_0_comp_ff;
extern compop_func op_e098_0_comp_ff; extern compop_func op_e098_0_comp_ff;
extern compop_func op_e0a0_0_comp_ff; extern compop_func op_e0a0_0_comp_ff;
extern compop_func op_e0a8_0_comp_ff; extern compop_func op_e0a8_0_comp_ff;
extern compop_func op_e0b0_0_comp_ff;
extern compop_func op_e0b8_0_comp_ff; extern compop_func op_e0b8_0_comp_ff;
extern compop_func op_e0d0_0_comp_ff; extern compop_func op_e0d0_0_comp_ff;
extern compop_func op_e0d8_0_comp_ff; extern compop_func op_e0d8_0_comp_ff;
@ -2913,27 +2907,21 @@ extern compop_func op_d1fb_0_comp_nf;
extern compop_func op_d1fc_0_comp_nf; extern compop_func op_d1fc_0_comp_nf;
extern compop_func op_e000_0_comp_nf; extern compop_func op_e000_0_comp_nf;
extern compop_func op_e008_0_comp_nf; extern compop_func op_e008_0_comp_nf;
extern compop_func op_e010_0_comp_nf;
extern compop_func op_e018_0_comp_nf; extern compop_func op_e018_0_comp_nf;
extern compop_func op_e020_0_comp_nf; extern compop_func op_e020_0_comp_nf;
extern compop_func op_e028_0_comp_nf; extern compop_func op_e028_0_comp_nf;
extern compop_func op_e030_0_comp_nf;
extern compop_func op_e038_0_comp_nf; extern compop_func op_e038_0_comp_nf;
extern compop_func op_e040_0_comp_nf; extern compop_func op_e040_0_comp_nf;
extern compop_func op_e048_0_comp_nf; extern compop_func op_e048_0_comp_nf;
extern compop_func op_e050_0_comp_nf;
extern compop_func op_e058_0_comp_nf; extern compop_func op_e058_0_comp_nf;
extern compop_func op_e060_0_comp_nf; extern compop_func op_e060_0_comp_nf;
extern compop_func op_e068_0_comp_nf; extern compop_func op_e068_0_comp_nf;
extern compop_func op_e070_0_comp_nf;
extern compop_func op_e078_0_comp_nf; extern compop_func op_e078_0_comp_nf;
extern compop_func op_e080_0_comp_nf; extern compop_func op_e080_0_comp_nf;
extern compop_func op_e088_0_comp_nf; extern compop_func op_e088_0_comp_nf;
extern compop_func op_e090_0_comp_nf;
extern compop_func op_e098_0_comp_nf; extern compop_func op_e098_0_comp_nf;
extern compop_func op_e0a0_0_comp_nf; extern compop_func op_e0a0_0_comp_nf;
extern compop_func op_e0a8_0_comp_nf; extern compop_func op_e0a8_0_comp_nf;
extern compop_func op_e0b0_0_comp_nf;
extern compop_func op_e0b8_0_comp_nf; extern compop_func op_e0b8_0_comp_nf;
extern compop_func op_e0d0_0_comp_nf; extern compop_func op_e0d0_0_comp_nf;
extern compop_func op_e0d8_0_comp_nf; extern compop_func op_e0d8_0_comp_nf;

View file

@ -108,7 +108,7 @@
//#define DISABLE_I_ROL //#define DISABLE_I_ROL
//#define DISABLE_I_ROR //#define DISABLE_I_ROR
//#define DISABLE_I_ROXL //#define DISABLE_I_ROXL
//#define DISABLE_I_ROXR #define DISABLE_I_ROXR
//#define DISABLE_I_ASRW //#define DISABLE_I_ASRW
//#define DISABLE_I_ASLW //#define DISABLE_I_ASLW
//#define DISABLE_I_LSRW //#define DISABLE_I_LSRW
@ -275,32 +275,32 @@ static inline void gen_update_next_handler(void)
static void gen_writebyte(const char* address, const char* source) static void gen_writebyte(const char* address, const char* source)
{ {
comprintf("\twritebyte(%s,%s);\n", address, source); comprintf("\twritebyte(%s,%s,scratchie);\n", address, source);
} }
static void gen_writeword(const char* address, const char* source) static void gen_writeword(const char* address, const char* source)
{ {
comprintf("\twriteword(%s,%s);\n", address, source); comprintf("\twriteword(%s,%s,scratchie);\n", address, source);
} }
static void gen_writelong(const char* address, const char* source) static void gen_writelong(const char* address, const char* source)
{ {
comprintf("\twritelong(%s,%s);\n", address, source); comprintf("\twritelong(%s,%s,scratchie);\n", address, source);
} }
static void gen_readbyte(const char* address, const char* dest) static void gen_readbyte(const char* address, const char* dest)
{ {
comprintf("\treadbyte(%s,%s);\n", address, dest); comprintf("\treadbyte(%s,%s,scratchie);\n", address, dest);
} }
static void gen_readword(const char* address, const char* dest) static void gen_readword(const char* address, const char* dest)
{ {
comprintf("\treadword(%s,%s);\n", address, dest); comprintf("\treadword(%s,%s,scratchie);\n", address, dest);
} }
static void gen_readlong(const char* address, const char* dest) static void gen_readlong(const char* address, const char* dest)
{ {
comprintf("\treadlong(%s,%s);\n", address, dest); comprintf("\treadlong(%s,%s,scratchie);\n", address, dest);
} }
@ -443,7 +443,7 @@ static void genamode(amodes mode, const char *reg, wordsizes size, const char *n
break; break;
case Ad8r: case Ad8r:
comprintf("\tint %sa=scratchie++;\n", name); comprintf("\tint %sa=scratchie++;\n", name);
comprintf("\tcalc_disp_ea_020(%s+8,%s,%sa);\n", reg, gen_nextiword(), name); comprintf("\tcalc_disp_ea_020(%s+8,%s,%sa,scratchie);\n", reg, gen_nextiword(), name);
break; break;
case PC16: case PC16:
@ -460,7 +460,7 @@ static void genamode(amodes mode, const char *reg, wordsizes size, const char *n
start_brace(); start_brace();
comprintf("\tmov_l_ri(pctmp,address);\n"); comprintf("\tmov_l_ri(pctmp,address);\n");
comprintf("\tcalc_disp_ea_020(pctmp,%s,%sa);\n", gen_nextiword(), name); comprintf("\tcalc_disp_ea_020(pctmp,%s,%sa,scratchie);\n", gen_nextiword(), name);
break; break;
case absw: case absw:
comprintf("\tint %sa = scratchie++;\n", name); comprintf("\tint %sa = scratchie++;\n", name);
@ -659,7 +659,7 @@ static void genamode_new(amodes mode, const char *reg, wordsizes size, const cha
break; break;
case Ad8r: case Ad8r:
comprintf("\tint %sa=scratchie++;\n", name); comprintf("\tint %sa=scratchie++;\n", name);
comprintf("\tcalc_disp_ea_020(%s+8,%s,%sa);\n", reg, gen_nextiword(), name); comprintf("\tcalc_disp_ea_020(%s+8,%s,%sa,scratchie);\n", reg, gen_nextiword(), name);
break; break;
case PC16: case PC16:
@ -675,7 +675,7 @@ static void genamode_new(amodes mode, const char *reg, wordsizes size, const cha
comprintf("\tuae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;\n"); comprintf("\tuae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;\n");
comprintf("\tmov_l_ri(pctmp,address);\n"); comprintf("\tmov_l_ri(pctmp,address);\n");
comprintf("\tcalc_disp_ea_020(pctmp,%s,%sa);\n", gen_nextiword(), name); comprintf("\tcalc_disp_ea_020(pctmp,%s,%sa,scratchie);\n", gen_nextiword(), name);
break; break;
case absw: case absw:
comprintf("\tint %sa = scratchie++;\n", name); comprintf("\tint %sa = scratchie++;\n", name);
@ -1006,7 +1006,7 @@ static void genmovemel(uae_u16 opcode)
comprintf("\tif (!special_mem) {\n"); comprintf("\tif (!special_mem) {\n");
/* Fast but unsafe... */ /* Fast but unsafe... */
comprintf("\tget_n_addr(srca,native);\n"); comprintf("\tget_n_addr(srca,native,scratchie);\n");
comprintf("\tfor (i=0;i<16;i++) {\n" comprintf("\tfor (i=0;i<16;i++) {\n"
"\t\tif ((mask>>i)&1) {\n"); "\t\tif ((mask>>i)&1) {\n");
@ -1037,11 +1037,11 @@ static void genmovemel(uae_u16 opcode)
"\t\t\tif ((mask>>i)&1) {\n"); "\t\t\tif ((mask>>i)&1) {\n");
switch(table68k[opcode].size) { switch(table68k[opcode].size) {
case sz_long: case sz_long:
comprintf("\t\t\t\treadlong(tmp,i);\n" comprintf("\t\t\t\treadlong(tmp,i,scratchie);\n"
"\t\t\t\tarm_ADD_l_ri8(tmp,4);\n"); "\t\t\t\tarm_ADD_l_ri8(tmp,4);\n");
break; break;
case sz_word: case sz_word:
comprintf("\t\t\t\treadword(tmp,i);\n" comprintf("\t\t\t\treadword(tmp,i,scratchie);\n"
"\t\t\t\tarm_ADD_l_ri8(tmp,2);\n"); "\t\t\t\tarm_ADD_l_ri8(tmp,2);\n");
break; break;
default: abort(); default: abort();
@ -1071,7 +1071,7 @@ static void genmovemle(uae_u16 opcode)
act of cleverness means that movmle must pay attention to special_mem, act of cleverness means that movmle must pay attention to special_mem,
or Genetic Species is a rather boring-looking game ;-) */ or Genetic Species is a rather boring-looking game ;-) */
comprintf("\tif (!special_mem) {\n"); comprintf("\tif (!special_mem) {\n");
comprintf("\tget_n_addr(srca,native);\n"); comprintf("\tget_n_addr(srca,native,scratchie);\n");
if (table68k[opcode].dmode != Apdi) { if (table68k[opcode].dmode != Apdi) {
comprintf("\tfor (i=0;i<16;i++) {\n" comprintf("\tfor (i=0;i<16;i++) {\n"
@ -1120,11 +1120,11 @@ static void genmovemle(uae_u16 opcode)
"\t\tif ((mask>>i)&1) {\n"); "\t\tif ((mask>>i)&1) {\n");
switch(table68k[opcode].size) { switch(table68k[opcode].size) {
case sz_long: case sz_long:
comprintf("\t\t\twritelong(tmp,i);\n" comprintf("\t\t\twritelong(tmp,i,scratchie);\n"
"\t\t\tarm_ADD_l_ri8(tmp,4);\n"); "\t\t\tarm_ADD_l_ri8(tmp,4);\n");
break; break;
case sz_word: case sz_word:
comprintf("\t\t\twriteword(tmp,i);\n" comprintf("\t\t\twriteword(tmp,i,scratchie);\n"
"\t\t\tarm_ADD_l_ri8(tmp,2);\n"); "\t\t\tarm_ADD_l_ri8(tmp,2);\n");
break; break;
default: abort(); default: abort();
@ -1136,11 +1136,11 @@ static void genmovemle(uae_u16 opcode)
switch(table68k[opcode].size) { switch(table68k[opcode].size) {
case sz_long: case sz_long:
comprintf("\t\t\tarm_SUB_l_ri8(srca,4);\n" comprintf("\t\t\tarm_SUB_l_ri8(srca,4);\n"
"\t\t\twritelong(srca,15-i);\n"); "\t\t\twritelong(srca,15-i,scratchie);\n");
break; break;
case sz_word: case sz_word:
comprintf("\t\t\tarm_SUB_l_ri8(srca,2);\n" comprintf("\t\t\tarm_SUB_l_ri8(srca,2);\n"
"\t\t\twriteword(srca,15-i);\n"); "\t\t\twriteword(srca,15-i,scratchie);\n");
break; break;
default: abort(); default: abort();
} }
@ -1245,6 +1245,14 @@ static void gen_andsr(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_asl(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_asl(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0);
@ -1289,6 +1297,15 @@ static void gen_aslw(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_asr(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_asr(uae_u32 opcode, struct instr *curi, char* ssize) {
(void)opcode; (void)opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0);
@ -1647,6 +1664,14 @@ static void gen_ext(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_lsl(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_lsl(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\tdont_care_flags();\n"); comprintf("\tdont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0);
@ -1690,6 +1715,14 @@ static void gen_lslw(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_lsr(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_lsr(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "", 1, 0);
@ -1937,6 +1970,14 @@ static void gen_orsr(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_rol(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_rol(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0);
genamode_new(curi->dmode, "dstreg", curi->size, "data", 1, 0); genamode_new(curi->dmode, "dstreg", curi->size, "data", 1, 0);
@ -1968,6 +2009,14 @@ static void gen_rolw(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_ror(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_ror(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0);
genamode_new(curi->dmode, "dstreg", curi->size, "data", 1, 0); genamode_new(curi->dmode, "dstreg", curi->size, "data", 1, 0);
@ -1999,6 +2048,14 @@ static void gen_rorw(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_roxl(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_roxl(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
isaddx; isaddx;
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0);
@ -2034,6 +2091,15 @@ static void gen_roxlw(uae_u32 opcode, struct instr *curi, char* ssize) {
static void gen_roxr(uae_u32 opcode, struct instr *curi, char* ssize) { static void gen_roxr(uae_u32 opcode, struct instr *curi, char* ssize) {
(void) opcode; (void) opcode;
(void) ssize;
mayfail;
if (curi->smode == Dreg) {
comprintf("if ((uae_u32)srcreg==(uae_u32)dstreg) {\n"
" FAIL(1);\n"
" " RETURN "\n"
"} \n");
start_brace();
}
isaddx; isaddx;
comprintf("\t dont_care_flags();\n"); comprintf("\t dont_care_flags();\n");
genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "cnt", 1, 0);
@ -2531,9 +2597,9 @@ static int gen_opcode(unsigned long int opcode)
comprintf("\tarm_ADD_l_ri8(offs,4);\n"); comprintf("\tarm_ADD_l_ri8(offs,4);\n");
start_brace(); start_brace();
comprintf("\tint newad=scratchie++;\n" comprintf("\tint newad=scratchie++;\n"
"\treadlong(15,newad);\n" "\treadlong(15,newad,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc,newad);\n" "\tmov_l_mr((uintptr)&regs.pc,newad);\n"
"\tget_n_addr_jmp(newad,PC_P);\n" "\tget_n_addr_jmp(newad,PC_P,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n" "\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n"
"\tm68k_pc_offset=0;\n" "\tm68k_pc_offset=0;\n"
"\tarm_ADD_l(15,offs);\n"); "\tarm_ADD_l(15,offs);\n");
@ -2548,7 +2614,7 @@ static int gen_opcode(unsigned long int opcode)
genamode_new(curi->smode, "srcreg", sz_long, "src", 1, 0); genamode_new(curi->smode, "srcreg", sz_long, "src", 1, 0);
genamode_new(curi->dmode, "dstreg", curi->size, "offs", 1, 0); genamode_new(curi->dmode, "dstreg", curi->size, "offs", 1, 0);
comprintf("\tsub_l_ri(15,4);\n" comprintf("\tsub_l_ri(15,4);\n"
"\twritelong_clobber(15,src);\n" "\twritelong_clobber(15,src,scratchie);\n"
"\tmov_l_rr(src,15);\n"); "\tmov_l_rr(src,15);\n");
comprintf("\tarm_ADD_l(15,offs);\n"); comprintf("\tarm_ADD_l(15,offs);\n");
genastore("src", curi->smode, "srcreg", sz_long, "src"); genastore("src", curi->smode, "srcreg", sz_long, "src");
@ -2560,7 +2626,7 @@ static int gen_opcode(unsigned long int opcode)
#endif #endif
genamode_new(curi->smode, "srcreg", curi->size, "src", 1, 0); genamode_new(curi->smode, "srcreg", curi->size, "src", 1, 0);
comprintf("\tmov_l_rr(15,src);\n" comprintf("\tmov_l_rr(15,src);\n"
"\treadlong(15,src);\n" "\treadlong(15,src,scratchie);\n"
"\tarm_ADD_l_ri8(15,4);\n"); "\tarm_ADD_l_ri8(15,4);\n");
genastore("src", curi->smode, "srcreg", curi->size, "src"); genastore("src", curi->smode, "srcreg", curi->size, "src");
break; break;
@ -2570,9 +2636,9 @@ static int gen_opcode(unsigned long int opcode)
failure; failure;
#endif #endif
comprintf("\tint newad=scratchie++;\n" comprintf("\tint newad=scratchie++;\n"
"\treadlong(15,newad);\n" "\treadlong(15,newad,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc,newad);\n" "\tmov_l_mr((uintptr)&regs.pc,newad);\n"
"\tget_n_addr_jmp(newad,PC_P);\n" "\tget_n_addr_jmp(newad,PC_P,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n" "\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n"
"\tm68k_pc_offset=0;\n" "\tm68k_pc_offset=0;\n"
"\tarm_ADD_l_ri8(15,4);\n"); "\tarm_ADD_l_ri8(15,4);\n");
@ -2602,9 +2668,9 @@ static int gen_opcode(unsigned long int opcode)
comprintf("\tint ret=scratchie++;\n" comprintf("\tint ret=scratchie++;\n"
"\tmov_l_ri(ret,retadd);\n" "\tmov_l_ri(ret,retadd);\n"
"\tsub_l_ri(15,4);\n" "\tsub_l_ri(15,4);\n"
"\twritelong_clobber(15,ret);\n"); "\twritelong_clobber(15,ret,scratchie);\n");
comprintf("\tmov_l_mr((uintptr)&regs.pc,srca);\n" comprintf("\tmov_l_mr((uintptr)&regs.pc,srca);\n"
"\tget_n_addr_jmp(srca,PC_P);\n" "\tget_n_addr_jmp(srca,PC_P,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n" "\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n"
"\tm68k_pc_offset=0;\n"); "\tm68k_pc_offset=0;\n");
gen_update_next_handler(); gen_update_next_handler();
@ -2617,7 +2683,7 @@ static int gen_opcode(unsigned long int opcode)
isjump; isjump;
genamode_new(curi->smode, "srcreg", curi->size, "src", 0, 0); genamode_new(curi->smode, "srcreg", curi->size, "src", 0, 0);
comprintf("\tmov_l_mr((uintptr)&regs.pc,srca);\n" comprintf("\tmov_l_mr((uintptr)&regs.pc,srca);\n"
"\tget_n_addr_jmp(srca,PC_P);\n" "\tget_n_addr_jmp(srca,PC_P,scratchie);\n"
"\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n" "\tmov_l_mr((uintptr)&regs.pc_oldp,PC_P);\n"
"\tm68k_pc_offset=0;\n"); "\tm68k_pc_offset=0;\n");
gen_update_next_handler(); gen_update_next_handler();
@ -2636,7 +2702,7 @@ static int gen_opcode(unsigned long int opcode)
comprintf("\tint ret=scratchie++;\n" comprintf("\tint ret=scratchie++;\n"
"\tmov_l_ri(ret,retadd);\n" "\tmov_l_ri(ret,retadd);\n"
"\tsub_l_ri(15,4);\n" "\tsub_l_ri(15,4);\n"
"\twritelong_clobber(15,ret);\n"); "\twritelong_clobber(15,ret,scratchie);\n");
comprintf("\tarm_ADD_l_ri(src,m68k_pc_offset_thisinst+2);\n"); comprintf("\tarm_ADD_l_ri(src,m68k_pc_offset_thisinst+2);\n");
comprintf("\tm68k_pc_offset=0;\n"); comprintf("\tm68k_pc_offset=0;\n");
comprintf("\tarm_ADD_l(PC_P,src);\n"); comprintf("\tarm_ADD_l(PC_P,src);\n");

View file

@ -29,7 +29,7 @@ void InitPanelAbout(const struct _ConfigCategory& category)
{ {
amiberryLogoImage = gcn::Image::load("data/amiberry-logo.png"); amiberryLogoImage = gcn::Image::load("data/amiberry-logo.png");
icon = new gcn::Icon(amiberryLogoImage); icon = new gcn::Icon(amiberryLogoImage);
lblEmulatorVersion = new gcn::Label("Amiberry v2.19"); lblEmulatorVersion = new gcn::Label("Amiberry v2.20 beta");
textBox = new gcn::TextBox( textBox = new gcn::TextBox(
"Dimitris Panokostas (MiDWaN) - Amiberry author\n" "Dimitris Panokostas (MiDWaN) - Amiberry author\n"