]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix JIT LINK with A7 fallback
authorDimitris Panokostas <midwan@gmail.com>
Thu, 4 Jun 2026 13:47:44 +0000 (15:47 +0200)
committerDimitris Panokostas <midwan@gmail.com>
Thu, 4 Jun 2026 13:47:44 +0000 (15:47 +0200)
jit/arm/compemu_arm.cpp
jit/compemu.cpp
jit/gencomp.cpp
jit/gencomp_arm.c

index 72de3359f17e78df0ab89bbc9f0e66615967ea39..3f8d299ebad8a36860a13068d3ae8a8c452925a4 100644 (file)
@@ -11355,6 +11355,11 @@ uae_u32 REGPARAM2 op_4808_0_comp_ff(uae_u32 opcode) {
        uae_s32 srcreg = (opcode & 7);
        uae_u32 m68k_pc_offset_thisinst = m68k_pc_offset;
        m68k_pc_offset += 2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        int dodgy = 0;
        if (srcreg == 7) dodgy = 1;
        int src = dodgy ? alloc_scratch() : srcreg + 8;
@@ -13964,6 +13969,11 @@ uae_u32 REGPARAM2 op_4e50_0_comp_ff(uae_u32 opcode) {
        uae_s32 srcreg = (opcode & 7);
        uae_u32 m68k_pc_offset_thisinst = m68k_pc_offset;
        m68k_pc_offset += 2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        int dodgy = 0;
        if (srcreg == 7) dodgy = 1;
        int src = dodgy ? alloc_scratch() : srcreg + 8;
@@ -38554,6 +38564,11 @@ uae_u32 REGPARAM2 op_4808_0_comp_nf(uae_u32 opcode) {
        uae_s32 srcreg = (opcode & 7);
        uae_u32 m68k_pc_offset_thisinst = m68k_pc_offset;
        m68k_pc_offset += 2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        int dodgy = 0;
        if (srcreg == 7) dodgy = 1;
        int src = dodgy ? alloc_scratch() : srcreg + 8;
@@ -41066,6 +41081,11 @@ uae_u32 REGPARAM2 op_4e50_0_comp_nf(uae_u32 opcode) {
        uae_s32 srcreg = (opcode & 7);
        uae_u32 m68k_pc_offset_thisinst = m68k_pc_offset;
        m68k_pc_offset += 2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        int dodgy = 0;
        if (srcreg == 7) dodgy = 1;
        int src = dodgy ? alloc_scratch() : srcreg + 8;
index f3534b2b705bfb2ba75857fbf1f7b34815734c61..c7a9da64cac6531a69048de4eb744379aec5a1ff 100644 (file)
@@ -24929,6 +24929,11 @@ uae_u32 REGPARAM2 op_4808_0_comp_ff(uae_u32 opcode) /* LINK */
        uae_u32 dodgy=0;
        uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
        m68k_pc_offset+=2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        {
                uae_u8 scratchie=S1;
                {
@@ -27698,6 +27703,11 @@ uae_u32 REGPARAM2 op_4e50_0_comp_ff(uae_u32 opcode) /* LINK */
        uae_u32 dodgy=0;
        uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
        m68k_pc_offset+=2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        {
                uae_u8 scratchie=S1;
                {
@@ -76044,6 +76054,11 @@ uae_u32 REGPARAM2 op_4808_0_comp_nf(uae_u32 opcode) /* LINK */
        uae_u32 dodgy=0;
        uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
        m68k_pc_offset+=2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        {
                uae_u8 scratchie=S1;
                {
@@ -78951,6 +78966,11 @@ uae_u32 REGPARAM2 op_4e50_0_comp_nf(uae_u32 opcode) /* LINK */
        uae_u32 dodgy=0;
        uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
        m68k_pc_offset+=2;
+       if (srcreg == 7) {
+               m68k_pc_offset = m68k_pc_offset_thisinst;
+               FAIL(1);
+               return 0;
+       }
        {
                uae_u8 scratchie=S1;
                {
index a6ccb650d31583143027dfb1df07150ae71fe647..7488bba799749e32ec7c584e42905683dcfc8f2c 100644 (file)
@@ -1971,6 +1971,11 @@ gen_opcode(unsigned int opcode)
 #ifdef DISABLE_I_LINK
                failure;
 #endif
+               comprintf("\tif (srcreg == 7) {\n"
+                       "\t\tm68k_pc_offset = m68k_pc_offset_thisinst;\n"
+                       "\t\tFAIL(1);\n"
+                       "\t\t" RETURN "\n"
+                       "\t}\n");
                genamode(curi->smode, "srcreg", sz_long, "src", GENA_GETV_FETCH, GENA_MOVEM_DO_INC);
                genamode(curi->dmode, "dstreg", curi->size, "offs", GENA_GETV_FETCH, GENA_MOVEM_DO_INC);
                comprintf("\tsub_l_ri(SP_REG,4);\n"
index 4742bff3ea8959d74e3bc755fa010dd9e53b203b..62431889f6e7e9bcc71b7e27701ae3b817373298 100644 (file)
@@ -4204,6 +4204,11 @@ gen_opcode(unsigned long int opcode) {
                break;
 
        case i_LINK:
+               comprintf("\tif (srcreg == 7) {\n"
+                               "\t\tm68k_pc_offset = m68k_pc_offset_thisinst;\n"
+                               "\t\tFAIL(1);\n"
+                               "\t\treturn;\n"
+                               "\t}\n");
                genamode(curi->smode, "srcreg", sz_long, "src", 1, 0);
                genamode(curi->dmode, "dstreg", curi->size, "offs", 1, 0);
                comprintf("\tsub_l_ri(15,4);\n"