Diff for /np2/i386c/ia32/instructions/arith.mcr between versions 1.3 and 1.6

version 1.3, 2011/01/15 17:17:23 version 1.6, 2012/01/08 19:09:40
Line 28 Line 28
   
 /* args == 1 */  /* args == 1 */
 #define ARITH_INSTRUCTION_1(inst) \  #define ARITH_INSTRUCTION_1(inst) \
 static UINT32 \  static UINT32 CPUCALL \
 inst##1(UINT32 dst, void *arg) \  inst##1(UINT32 dst, void *arg) \
 { \  { \
         (void)arg; \  
         BYTE_##inst(dst); \          BYTE_##inst(dst); \
         return dst; \          return dst; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##2(UINT32 dst, void *arg) \  inst##2(UINT32 dst, void *arg) \
 { \  { \
         (void)arg; \  
         WORD_##inst(dst); \          WORD_##inst(dst); \
         return dst; \          return dst; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##4(UINT32 dst, void *arg) \  inst##4(UINT32 dst, void *arg) \
 { \  { \
         (void)arg; \  
         DWORD_##inst(dst); \          DWORD_##inst(dst); \
         return dst; \          return dst; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_Eb(UINT32 op) \  inst##_Eb(UINT32 op) \
 { \  { \
         UINT8 *out; \          UINT8 *out; \
Line 65  inst##_Eb(UINT32 op) \ Line 62  inst##_Eb(UINT32 op) \
         } else { \          } else { \
                 CPU_WORKCLOCK(5); \                  CPU_WORKCLOCK(5); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW(CPU_INST_SEGREG_INDEX, madr, inst##1, 0); \                  cpu_vmemory_RMW_b(CPU_INST_SEGREG_INDEX, madr, inst##1, 0); \
         } \          } \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_Ew(UINT32 op) \  inst##_Ew(UINT32 op) \
 { \  { \
         UINT16 *out; \          UINT16 *out; \
Line 84  inst##_Ew(UINT32 op) \ Line 81  inst##_Ew(UINT32 op) \
         } else { \          } else { \
                 CPU_WORKCLOCK(5); \                  CPU_WORKCLOCK(5); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, 0); \                  cpu_vmemory_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, 0); \
         } \          } \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_Ed(UINT32 op) \  inst##_Ed(UINT32 op) \
 { \  { \
         UINT32 *out; \          UINT32 *out; \
Line 103  inst##_Ed(UINT32 op) \ Line 100  inst##_Ed(UINT32 op) \
         } else { \          } else { \
                 CPU_WORKCLOCK(5); \                  CPU_WORKCLOCK(5); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, 0); \                  cpu_vmemory_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, 0); \
         } \          } \
 }  }
   
 /* args == 2 */  /* args == 2 */
 #define ARITH_INSTRUCTION_2(inst) \  #define ARITH_INSTRUCTION_2(inst) \
 static UINT32 \  static UINT32 CPUCALL \
 inst##1(UINT32 dst, void *arg) \  inst##1(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
         BYTE_##inst(dst, src); \          BYTE_##inst(dst, src); \
         return dst; \          return dst; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##2(UINT32 dst, void *arg) \  inst##2(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
         WORD_##inst(dst, src); \          WORD_##inst(dst, src); \
         return dst; \          return dst; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##4(UINT32 dst, void *arg) \  inst##4(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
Line 147  inst##_EbGb(void) \ Line 144  inst##_EbGb(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_b(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 167  inst##_EwGw(void) \ Line 164  inst##_EwGw(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 187  inst##_EdGd(void) \ Line 184  inst##_EdGd(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 263  inst##_EAXId(void) \ Line 260  inst##_EAXId(void) \
         CPU_EAX = dst; \          CPU_EAX = dst; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EbIb(UINT8 *regp, UINT32 src) \  inst##_EbIb(UINT8 *regp, UINT32 src) \
 { \  { \
         UINT32 dst; \          UINT32 dst; \
Line 273  inst##_EbIb(UINT8 *regp, UINT32 src) \ Line 270  inst##_EbIb(UINT8 *regp, UINT32 src) \
         *regp = (UINT8)dst; \          *regp = (UINT8)dst; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EbIb_ext(UINT32 madr, UINT32 src) \  inst##_EbIb_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_b(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EwIx(UINT16 *regp, UINT32 src) \  inst##_EwIx(UINT16 *regp, UINT32 src) \
 { \  { \
         UINT32 dst; \          UINT32 dst; \
Line 290  inst##_EwIx(UINT16 *regp, UINT32 src) \ Line 287  inst##_EwIx(UINT16 *regp, UINT32 src) \
         *regp = (UINT16)dst; \          *regp = (UINT16)dst; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EwIx_ext(UINT32 madr, UINT32 src) \  inst##_EwIx_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EdIx(UINT32 *regp, UINT32 src) \  inst##_EdIx(UINT32 *regp, UINT32 src) \
 { \  { \
         UINT32 dst; \          UINT32 dst; \
Line 307  inst##_EdIx(UINT32 *regp, UINT32 src) \ Line 304  inst##_EdIx(UINT32 *regp, UINT32 src) \
         *regp = dst; \          *regp = dst; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EdIx_ext(UINT32 madr, UINT32 src) \  inst##_EdIx_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \
 }  }
   
 /* args == 3 */  /* args == 3 */
 #define ARITH_INSTRUCTION_3(inst) \  #define ARITH_INSTRUCTION_3(inst) \
 static UINT32 \  static UINT32 CPUCALL \
 inst##1(UINT32 dst, void *arg) \  inst##1(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
Line 324  inst##1(UINT32 dst, void *arg) \ Line 321  inst##1(UINT32 dst, void *arg) \
         BYTE_##inst(res, dst, src); \          BYTE_##inst(res, dst, src); \
         return res; \          return res; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##2(UINT32 dst, void *arg) \  inst##2(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
Line 332  inst##2(UINT32 dst, void *arg) \ Line 329  inst##2(UINT32 dst, void *arg) \
         WORD_##inst(res, dst, src); \          WORD_##inst(res, dst, src); \
         return res; \          return res; \
 } \  } \
 static UINT32 \  static UINT32 CPUCALL \
 inst##4(UINT32 dst, void *arg) \  inst##4(UINT32 dst, void *arg) \
 { \  { \
         UINT32 src = PTR_TO_UINT32(arg); \          UINT32 src = PTR_TO_UINT32(arg); \
Line 357  inst##_EbGb(void) \ Line 354  inst##_EbGb(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_b(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 377  inst##_EwGw(void) \ Line 374  inst##_EwGw(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 397  inst##_EdGd(void) \ Line 394  inst##_EdGd(void) \
         } else { \          } else { \
                 CPU_WORKCLOCK(7); \                  CPU_WORKCLOCK(7); \
                 madr = calc_ea_dst(op); \                  madr = calc_ea_dst(op); \
                 cpu_memory_access_va_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \                  cpu_vmemory_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \
         } \          } \
 } \  } \
 \  \
Line 473  inst##_EAXId(void) \ Line 470  inst##_EAXId(void) \
         CPU_EAX = res; \          CPU_EAX = res; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EbIb(UINT8 *regp, UINT32 src) \  inst##_EbIb(UINT8 *regp, UINT32 src) \
 { \  { \
         UINT32 dst, res; \          UINT32 dst, res; \
Line 483  inst##_EbIb(UINT8 *regp, UINT32 src) \ Line 480  inst##_EbIb(UINT8 *regp, UINT32 src) \
         *regp = (UINT8)res; \          *regp = (UINT8)res; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EbIb_ext(UINT32 madr, UINT32 src) \  inst##_EbIb_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_b(CPU_INST_SEGREG_INDEX, madr, inst##1, UINT32_TO_PTR(src)); \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EwIx(UINT16 *regp, UINT32 src) \  inst##_EwIx(UINT16 *regp, UINT32 src) \
 { \  { \
         UINT32 dst, res; \          UINT32 dst, res; \
Line 500  inst##_EwIx(UINT16 *regp, UINT32 src) \ Line 497  inst##_EwIx(UINT16 *regp, UINT32 src) \
         *regp = (UINT16)res; \          *regp = (UINT16)res; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EwIx_ext(UINT32 madr, UINT32 src) \  inst##_EwIx_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_w(CPU_INST_SEGREG_INDEX, madr, inst##2, UINT32_TO_PTR(src)); \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EdIx(UINT32 *regp, UINT32 src) \  inst##_EdIx(UINT32 *regp, UINT32 src) \
 { \  { \
         UINT32 dst, res; \          UINT32 dst, res; \
Line 517  inst##_EdIx(UINT32 *regp, UINT32 src) \ Line 514  inst##_EdIx(UINT32 *regp, UINT32 src) \
         *regp = res; \          *regp = res; \
 } \  } \
 \  \
 void \  void CPUCALL \
 inst##_EdIx_ext(UINT32 madr, UINT32 src) \  inst##_EdIx_ext(UINT32 madr, UINT32 src) \
 { \  { \
 \  \
         cpu_memory_access_va_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \          cpu_vmemory_RMW_d(CPU_INST_SEGREG_INDEX, madr, inst##4, UINT32_TO_PTR(src)); \
 }  }
   
 #endif  /* IA32_CPU_ARITH_MCR__ */  #endif  /* IA32_CPU_ARITH_MCR__ */

Removed from v.1.3  
changed lines
  Added in v.1.6


RetroPC.NET-CVS <cvs@retropc.net>