Annotation of tme/ic/m68k/m68k-auto.h, revision 1.1.1.3

1.1       root        1: /* automatically generated by m68k-misc-auto.sh, do not edit! */
                      2: 
                      3: #ifndef _IC_M68K_MISC_H
                      4: #define _IC_M68K_MISC_H
                      5: 
                      6: /* the register mapping: */
                      7: #define TME_M68K_IREG_UNDEF            (-1)
                      8: #define TME_M68K_IREG_D0               (0)
                      9: #define tme_m68k_ireg_d0               tme_m68k_ireg_uint32(TME_M68K_IREG_D0)
                     10: #define TME_M68K_IREG_D1               (1)
                     11: #define tme_m68k_ireg_d1               tme_m68k_ireg_uint32(TME_M68K_IREG_D1)
                     12: #define TME_M68K_IREG_D2               (2)
                     13: #define tme_m68k_ireg_d2               tme_m68k_ireg_uint32(TME_M68K_IREG_D2)
                     14: #define TME_M68K_IREG_D3               (3)
                     15: #define tme_m68k_ireg_d3               tme_m68k_ireg_uint32(TME_M68K_IREG_D3)
                     16: #define TME_M68K_IREG_D4               (4)
                     17: #define tme_m68k_ireg_d4               tme_m68k_ireg_uint32(TME_M68K_IREG_D4)
                     18: #define TME_M68K_IREG_D5               (5)
                     19: #define tme_m68k_ireg_d5               tme_m68k_ireg_uint32(TME_M68K_IREG_D5)
                     20: #define TME_M68K_IREG_D6               (6)
                     21: #define tme_m68k_ireg_d6               tme_m68k_ireg_uint32(TME_M68K_IREG_D6)
                     22: #define TME_M68K_IREG_D7               (7)
                     23: #define tme_m68k_ireg_d7               tme_m68k_ireg_uint32(TME_M68K_IREG_D7)
                     24: #define TME_M68K_IREG_A0               (8)
                     25: #define tme_m68k_ireg_a0               tme_m68k_ireg_uint32(TME_M68K_IREG_A0)
                     26: #define TME_M68K_IREG_A1               (9)
                     27: #define tme_m68k_ireg_a1               tme_m68k_ireg_uint32(TME_M68K_IREG_A1)
                     28: #define TME_M68K_IREG_A2               (10)
                     29: #define tme_m68k_ireg_a2               tme_m68k_ireg_uint32(TME_M68K_IREG_A2)
                     30: #define TME_M68K_IREG_A3               (11)
                     31: #define tme_m68k_ireg_a3               tme_m68k_ireg_uint32(TME_M68K_IREG_A3)
                     32: #define TME_M68K_IREG_A4               (12)
                     33: #define tme_m68k_ireg_a4               tme_m68k_ireg_uint32(TME_M68K_IREG_A4)
                     34: #define TME_M68K_IREG_A5               (13)
                     35: #define tme_m68k_ireg_a5               tme_m68k_ireg_uint32(TME_M68K_IREG_A5)
                     36: #define TME_M68K_IREG_A6               (14)
                     37: #define tme_m68k_ireg_a6               tme_m68k_ireg_uint32(TME_M68K_IREG_A6)
                     38: #define TME_M68K_IREG_A7               (15)
                     39: #define tme_m68k_ireg_a7               tme_m68k_ireg_uint32(TME_M68K_IREG_A7)
                     40: #define TME_M68K_IREG_PC               (16)
                     41: #define tme_m68k_ireg_pc               tme_m68k_ireg_uint32(TME_M68K_IREG_PC)
                     42: #define TME_M68K_IREG_PC_NEXT          (17)
                     43: #define tme_m68k_ireg_pc_next          tme_m68k_ireg_uint32(TME_M68K_IREG_PC_NEXT)
1.1.1.3 ! root       44: #define TME_M68K_IREG_PC_LAST          (18)
        !            45: #define tme_m68k_ireg_pc_last          tme_m68k_ireg_uint32(TME_M68K_IREG_PC_LAST)
        !            46: #define tme_m68k_ireg_sr               tme_m68k_ireg_uint16(19 << 1)
        !            47: #define tme_m68k_ireg_ccr              tme_m68k_ireg_uint8(19 << 2)
        !            48: #define TME_M68K_IREG_SHADOW_SR        (20 << 1)
1.1       root       49: #define tme_m68k_ireg_shadow_sr        tme_m68k_ireg_uint16(TME_M68K_IREG_SHADOW_SR)
1.1.1.3 ! root       50: #define TME_M68K_IREG_FORMAT_OFFSET    ((20 << 1) + 1)
1.1       root       51: #define tme_m68k_ireg_format_offset    tme_m68k_ireg_uint16(TME_M68K_IREG_FORMAT_OFFSET)
1.1.1.3 ! root       52: #define TME_M68K_IREG_MEMX32           (21)
1.1       root       53: #define tme_m68k_ireg_memx32           tme_m68k_ireg_uint32(TME_M68K_IREG_MEMX32)
1.1.1.3 ! root       54: #define TME_M68K_IREG_MEMX16           (21 << 1)
1.1       root       55: #define tme_m68k_ireg_memx16           tme_m68k_ireg_uint16(TME_M68K_IREG_MEMX16)
1.1.1.3 ! root       56: #define TME_M68K_IREG_MEMX8            (21 << 2)
1.1       root       57: #define tme_m68k_ireg_memx8            tme_m68k_ireg_uint8(TME_M68K_IREG_MEMX8)
1.1.1.3 ! root       58: #define TME_M68K_IREG_MEMY32           (22)
1.1       root       59: #define tme_m68k_ireg_memy32           tme_m68k_ireg_uint32(TME_M68K_IREG_MEMY32)
1.1.1.3 ! root       60: #define TME_M68K_IREG_MEMY16           (22 << 1)
1.1       root       61: #define tme_m68k_ireg_memy16           tme_m68k_ireg_uint16(TME_M68K_IREG_MEMY16)
1.1.1.3 ! root       62: #define TME_M68K_IREG_MEMY8            (22 << 2)
1.1       root       63: #define tme_m68k_ireg_memy8            tme_m68k_ireg_uint8(TME_M68K_IREG_MEMY8)
1.1.1.3 ! root       64: #define TME_M68K_IREG_MEMZ32           (23)
1.1       root       65: #define tme_m68k_ireg_memz32           tme_m68k_ireg_uint32(TME_M68K_IREG_MEMZ32)
1.1.1.3 ! root       66: #define TME_M68K_IREG_MEMZ16           (23 << 1)
1.1       root       67: #define tme_m68k_ireg_memz16           tme_m68k_ireg_uint16(TME_M68K_IREG_MEMZ16)
1.1.1.3 ! root       68: #define TME_M68K_IREG_MEMZ8            (23 << 2)
1.1       root       69: #define tme_m68k_ireg_memz8            tme_m68k_ireg_uint8(TME_M68K_IREG_MEMZ8)
1.1.1.3 ! root       70: #define TME_M68K_IREG_USP              (24)
1.1       root       71: #define tme_m68k_ireg_usp              tme_m68k_ireg_uint32(TME_M68K_IREG_USP)
1.1.1.3 ! root       72: #define TME_M68K_IREG_ISP              (25)
1.1       root       73: #define tme_m68k_ireg_isp              tme_m68k_ireg_uint32(TME_M68K_IREG_ISP)
1.1.1.3 ! root       74: #define TME_M68K_IREG_MSP              (26)
1.1       root       75: #define tme_m68k_ireg_msp              tme_m68k_ireg_uint32(TME_M68K_IREG_MSP)
1.1.1.3 ! root       76: #define TME_M68K_IREG_SFC              (27)
1.1       root       77: #define tme_m68k_ireg_sfc              tme_m68k_ireg_uint32(TME_M68K_IREG_SFC)
1.1.1.3 ! root       78: #define TME_M68K_IREG_DFC              (28)
1.1       root       79: #define tme_m68k_ireg_dfc              tme_m68k_ireg_uint32(TME_M68K_IREG_DFC)
1.1.1.3 ! root       80: #define TME_M68K_IREG_VBR              (29)
1.1       root       81: #define tme_m68k_ireg_vbr              tme_m68k_ireg_uint32(TME_M68K_IREG_VBR)
1.1.1.3 ! root       82: #define TME_M68K_IREG_CACR             (30)
        !            83: #define tme_m68k_ireg_cacr             tme_m68k_ireg_uint32(TME_M68K_IREG_CACR)
        !            84: #define TME_M68K_IREG_CAAR             (31)
        !            85: #define tme_m68k_ireg_caar             tme_m68k_ireg_uint32(TME_M68K_IREG_CAAR)
        !            86: #define TME_M68K_IREG32_COUNT          (32)
        !            87: #define TME_M68K_IREG_IMM32            (32)
        !            88: #define tme_m68k_ireg_imm32            tme_m68k_ireg_uint32(TME_M68K_IREG_IMM32)
        !            89: #define TME_M68K_IREG_EA               (33)
        !            90: #define tme_m68k_ireg_ea               tme_m68k_ireg_uint32(TME_M68K_IREG_EA)
        !            91: #define TME_M68K_IREG_ZERO             (34)
        !            92: #define TME_M68K_IREG_ONE              (35)
        !            93: #define TME_M68K_IREG_TWO              (36)
        !            94: #define TME_M68K_IREG_THREE            (37)
        !            95: #define TME_M68K_IREG_FOUR             (38)
        !            96: #define TME_M68K_IREG_FIVE             (39)
        !            97: #define TME_M68K_IREG_SIX              (40)
        !            98: #define TME_M68K_IREG_SEVEN            (41)
        !            99: #define TME_M68K_IREG_EIGHT            (42)
1.1       root      100: 
                    101: #endif /* _IC_M68K_MISC_H */
                    102: 
                    103: #ifdef _TME_M68K_EXECUTE_FAST
                    104: 
                    105: /* these macros are for the fast executor: */
                    106: 
                    107: /* on all hosts, 
                    108:    this loads a 16-bit unsigned value for the fast instruction executor: */
                    109: #undef _TME_M68K_EXECUTE_FETCH_U16
                    110: #define _TME_M68K_EXECUTE_FETCH_U16(v) \
                    111:   if ((emulator_load + (sizeof(tme_uint16_t) - 1)) > emulator_load_last) \
                    112:     goto _tme_m68k_fast_fetch_failed; \
                    113:   tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    114:   (v) = (tme_uint16_t) tme_betoh_u16(*((tme_uint16_t *) emulator_load)); \
                    115:   tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    116:   insn_fetch_sizes <<= 1; \
                    117:   emulator_load += sizeof(tme_uint16_t)
                    118: 
                    119: /* on all hosts, 
                    120:    this loads a 16-bit signed value for the fast instruction executor: */
                    121: #undef _TME_M68K_EXECUTE_FETCH_S16
                    122: #define _TME_M68K_EXECUTE_FETCH_S16(v) \
                    123:   if ((emulator_load + (sizeof(tme_uint16_t) - 1)) > emulator_load_last) \
                    124:     goto _tme_m68k_fast_fetch_failed; \
                    125:   tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    126:   (v) = (tme_int16_t) tme_betoh_u16(*((tme_uint16_t *) emulator_load)); \
                    127:   tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    128:   insn_fetch_sizes <<= 1; \
                    129:   emulator_load += sizeof(tme_int16_t)
                    130: 
                    131: /* on a host with any alignment, 
                    132:    this loads a 32-bit unsigned value for the fast instruction executor: */
                    133: #if ALIGNOF_INT32_T <= ALIGNOF_INT16_T
                    134: #undef _TME_M68K_EXECUTE_FETCH_U32
                    135: #define _TME_M68K_EXECUTE_FETCH_U32(v) \
                    136:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    137:     goto _tme_m68k_fast_fetch_failed; \
                    138:   if (((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    139:     tme_memory_unaligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    140:     (v) = (tme_uint32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    141:     tme_memory_unaligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    142:   } \
                    143:   else { \
                    144:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    145:     (v) = (tme_uint32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    146:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    147:   } \
                    148:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    149:   emulator_load += sizeof(tme_uint32_t)
                    150: #endif /* ALIGNOF_INT32_T <= ALIGNOF_INT16_T */
                    151: 
                    152: /* on a host with any alignment, 
                    153:    this loads a 32-bit signed value for the fast instruction executor: */
                    154: #if ALIGNOF_INT32_T <= ALIGNOF_INT16_T
                    155: #undef _TME_M68K_EXECUTE_FETCH_S32
                    156: #define _TME_M68K_EXECUTE_FETCH_S32(v) \
                    157:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    158:     goto _tme_m68k_fast_fetch_failed; \
                    159:   if (((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    160:     tme_memory_unaligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    161:     (v) = (tme_int32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    162:     tme_memory_unaligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    163:   } \
                    164:   else { \
                    165:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    166:     (v) = (tme_int32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    167:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    168:   } \
                    169:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    170:   emulator_load += sizeof(tme_int32_t)
                    171: #endif /* ALIGNOF_INT32_T <= ALIGNOF_INT16_T */
                    172: 
                    173: /* on a little-endian host with strict alignment, 
                    174:    this loads a 32-bit unsigned value for the fast instruction executor: */
                    175: #if (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && !defined(WORDS_BIGENDIAN)
                    176: #undef _TME_M68K_EXECUTE_FETCH_U32
                    177: #define _TME_M68K_EXECUTE_FETCH_U32(v) \
                    178:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    179:     goto _tme_m68k_fast_fetch_failed; \
                    180:   if (TME_SEQUENCE_ACCESS_NOT_COSTLIER || ((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    181:     tme_memory_sequence_rdlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    182:     (v) = (tme_uint32_t) \
                    183:       tme_betoh_u32((((tme_uint32_t) ((tme_uint16_t *) emulator_load)[1]) << 16) | \
                    184:               ((tme_uint32_t) ((tme_uint16_t *) emulator_load)[0])); \
                    185:     tme_memory_sequence_unlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    186:   } else { \
                    187:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    188:     (v) = (tme_uint32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    189:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    190:   } \
                    191:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    192:   emulator_load += sizeof(tme_uint32_t)
                    193: #endif /* (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && !defined(WORDS_BIGENDIAN) */
                    194: 
                    195: /* on a little-endian host with strict alignment, 
                    196:    this loads a 32-bit signed value for the fast instruction executor: */
                    197: #if (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && !defined(WORDS_BIGENDIAN)
                    198: #undef _TME_M68K_EXECUTE_FETCH_S32
                    199: #define _TME_M68K_EXECUTE_FETCH_S32(v) \
                    200:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    201:     goto _tme_m68k_fast_fetch_failed; \
                    202:   if (TME_SEQUENCE_ACCESS_NOT_COSTLIER || ((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    203:     tme_memory_sequence_rdlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    204:     (v) = (tme_int32_t) \
                    205:       tme_betoh_u32((((tme_uint32_t) ((tme_uint16_t *) emulator_load)[1]) << 16) | \
                    206:               ((tme_uint32_t) ((tme_uint16_t *) emulator_load)[0])); \
                    207:     tme_memory_sequence_unlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    208:   } else { \
                    209:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    210:     (v) = (tme_int32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    211:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    212:   } \
                    213:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    214:   emulator_load += sizeof(tme_int32_t)
                    215: #endif /* (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && !defined(WORDS_BIGENDIAN) */
                    216: 
                    217: /* on a big-endian host with strict alignment, 
                    218:    this loads a 32-bit unsigned value for the fast instruction executor: */
                    219: #if (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && defined(WORDS_BIGENDIAN)
                    220: #undef _TME_M68K_EXECUTE_FETCH_U32
                    221: #define _TME_M68K_EXECUTE_FETCH_U32(v) \
                    222:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    223:     goto _tme_m68k_fast_fetch_failed; \
                    224:   if (TME_SEQUENCE_ACCESS_NOT_COSTLIER || ((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    225:     tme_memory_sequence_rdlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    226:     (v) = (tme_uint32_t) \
                    227:       ((((tme_uint32_t) ((tme_uint16_t *) emulator_load)[0]) << 16) | \
                    228:               ((tme_uint32_t) ((tme_uint16_t *) emulator_load)[1])); \
                    229:     tme_memory_sequence_unlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    230:   } else { \
                    231:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    232:     (v) = (tme_uint32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    233:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    234:   } \
                    235:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    236:   emulator_load += sizeof(tme_uint32_t)
                    237: #endif /* (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && defined(WORDS_BIGENDIAN) */
                    238: 
                    239: /* on a big-endian host with strict alignment, 
                    240:    this loads a 32-bit signed value for the fast instruction executor: */
                    241: #if (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && defined(WORDS_BIGENDIAN)
                    242: #undef _TME_M68K_EXECUTE_FETCH_S32
                    243: #define _TME_M68K_EXECUTE_FETCH_S32(v) \
                    244:   if ((emulator_load + (sizeof(tme_uint32_t) - 1)) > emulator_load_last) \
                    245:     goto _tme_m68k_fast_fetch_failed; \
                    246:   if (TME_SEQUENCE_ACCESS_NOT_COSTLIER || ((unsigned long) emulator_load) & (sizeof(tme_uint32_t) - 1)) { \
                    247:     tme_memory_sequence_rdlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    248:     (v) = (tme_int32_t) \
                    249:       ((((tme_uint32_t) ((tme_uint16_t *) emulator_load)[0]) << 16) | \
                    250:               ((tme_uint32_t) ((tme_uint16_t *) emulator_load)[1])); \
                    251:     tme_memory_sequence_unlock(tlb->tme_m68k_bus_tlb_rwlock); \
                    252:   } else { \
                    253:     tme_memory_aligned_rdlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    254:     (v) = (tme_int32_t) tme_betoh_u32(*((tme_uint32_t *) emulator_load)); \
                    255:     tme_memory_aligned_unlock(tlb->tme_m68k_tlb_bus_rwlock); \
                    256:   } \
                    257:   insn_fetch_sizes = (insn_fetch_sizes << 1) | 1; \
                    258:   emulator_load += sizeof(tme_int32_t)
                    259: #endif /* (ALIGNOF_INT32_T > ALIGNOF_INT16_T) && defined(WORDS_BIGENDIAN) */
                    260: 
                    261: #endif /* _TME_M68K_EXECUTE_FAST */
                    262: 
                    263: #ifndef _TME_M68K_EXECUTE_FAST
                    264: 
                    265: /* these macros are for the slow executor: */
                    266: 
                    267: /* on all hosts, this fetches a 16-bit unsigned value for the slow executor: */
                    268: #undef _TME_M68K_EXECUTE_FETCH_U16
                    269: #define _TME_M68K_EXECUTE_FETCH_U16(v) \
1.1.1.3 ! root      270:   /* we update the instruction buffer fetch total and sizes values \
        !           271:      before we do the actual fetch, because we may transfer a few \
        !           272:      bytes and then fault.  without this, those few bytes wouldn't get \
        !           273:      saved in the exception stack frame by tme_m68k_insn_buffer_xfer(), \
        !           274:      because it wouldn't know about the fetch.  later, when the \
        !           275:      instruction would be resumed, tme_m68k_fetch16() won't refetch \
        !           276:      them, because it knows they've already been fetched and thinks \
        !           277:      they're still in the instruction buffer: */ \
        !           278:   ic->_tme_m68k_insn_buffer_fetch_total += sizeof(tme_uint16_t); \
        !           279:   ic->_tme_m68k_insn_buffer_fetch_sizes <<= 1; \
1.1       root      280:   (v) = (tme_uint16_t) tme_m68k_fetch16(ic, linear_pc); \
                    281:   linear_pc += sizeof(tme_uint16_t)
                    282: 
                    283: /* on all hosts, this fetches a 16-bit signed value for the slow executor: */
                    284: #undef _TME_M68K_EXECUTE_FETCH_S16
                    285: #define _TME_M68K_EXECUTE_FETCH_S16(v) \
1.1.1.3 ! root      286:   /* we update the instruction buffer fetch total and sizes values \
        !           287:      before we do the actual fetch, because we may transfer a few \
        !           288:      bytes and then fault.  without this, those few bytes wouldn't get \
        !           289:      saved in the exception stack frame by tme_m68k_insn_buffer_xfer(), \
        !           290:      because it wouldn't know about the fetch.  later, when the \
        !           291:      instruction would be resumed, tme_m68k_fetch16() won't refetch \
        !           292:      them, because it knows they've already been fetched and thinks \
        !           293:      they're still in the instruction buffer: */ \
        !           294:   ic->_tme_m68k_insn_buffer_fetch_total += sizeof(tme_int16_t); \
        !           295:   ic->_tme_m68k_insn_buffer_fetch_sizes <<= 1; \
1.1       root      296:   (v) = (tme_int16_t) tme_m68k_fetch16(ic, linear_pc); \
                    297:   linear_pc += sizeof(tme_int16_t)
                    298: 
                    299: /* on all hosts, this fetches a 32-bit unsigned value for the slow executor: */
                    300: #undef _TME_M68K_EXECUTE_FETCH_U32
                    301: #define _TME_M68K_EXECUTE_FETCH_U32(v) \
1.1.1.3 ! root      302:   /* we update the instruction buffer fetch total and sizes values \
        !           303:      before we do the actual fetch, because we may transfer a few \
        !           304:      bytes and then fault.  without this, those few bytes wouldn't get \
        !           305:      saved in the exception stack frame by tme_m68k_insn_buffer_xfer(), \
        !           306:      because it wouldn't know about the fetch.  later, when the \
        !           307:      instruction would be resumed, tme_m68k_fetch32() won't refetch \
        !           308:      them, because it knows they've already been fetched and thinks \
        !           309:      they're still in the instruction buffer: */ \
        !           310:   ic->_tme_m68k_insn_buffer_fetch_total += sizeof(tme_uint32_t); \
        !           311:   ic->_tme_m68k_insn_buffer_fetch_sizes = (ic->_tme_m68k_insn_buffer_fetch_sizes << 1) | 1; \
1.1       root      312:   (v) = (tme_uint32_t) tme_m68k_fetch32(ic, linear_pc); \
                    313:   linear_pc += sizeof(tme_uint32_t)
                    314: 
                    315: /* on all hosts, this fetches a 32-bit signed value for the slow executor: */
                    316: #undef _TME_M68K_EXECUTE_FETCH_S32
                    317: #define _TME_M68K_EXECUTE_FETCH_S32(v) \
1.1.1.3 ! root      318:   /* we update the instruction buffer fetch total and sizes values \
        !           319:      before we do the actual fetch, because we may transfer a few \
        !           320:      bytes and then fault.  without this, those few bytes wouldn't get \
        !           321:      saved in the exception stack frame by tme_m68k_insn_buffer_xfer(), \
        !           322:      because it wouldn't know about the fetch.  later, when the \
        !           323:      instruction would be resumed, tme_m68k_fetch32() won't refetch \
        !           324:      them, because it knows they've already been fetched and thinks \
        !           325:      they're still in the instruction buffer: */ \
        !           326:   ic->_tme_m68k_insn_buffer_fetch_total += sizeof(tme_int32_t); \
        !           327:   ic->_tme_m68k_insn_buffer_fetch_sizes = (ic->_tme_m68k_insn_buffer_fetch_sizes << 1) | 1; \
1.1       root      328:   (v) = (tme_int32_t) tme_m68k_fetch32(ic, linear_pc); \
                    329:   linear_pc += sizeof(tme_int32_t)
                    330: 
                    331: #endif /* !_TME_M68K_EXECUTE_FAST */
                    332: /* automatically generated by m68k-insns-auto.sh, do not edit! */
1.1.1.3 ! root      333: _TME_RCSID("$Id: m68k-insns-auto.sh,v 1.23 2005/03/10 13:26:23 fredette Exp $");
1.1       root      334: 
                    335: TME_M68K_INSN_DECL(tme_m68k_add8);
                    336: TME_M68K_INSN_DECL(tme_m68k_sub8);
                    337: TME_M68K_INSN_DECL(tme_m68k_cmp8);
                    338: TME_M68K_INSN_DECL(tme_m68k_neg8);
                    339: TME_M68K_INSN_DECL(tme_m68k_or8);
                    340: TME_M68K_INSN_DECL(tme_m68k_and8);
                    341: TME_M68K_INSN_DECL(tme_m68k_eor8);
                    342: TME_M68K_INSN_DECL(tme_m68k_not8);
                    343: TME_M68K_INSN_DECL(tme_m68k_tst8);
                    344: TME_M68K_INSN_DECL(tme_m68k_move8);
                    345: TME_M68K_INSN_DECL(tme_m68k_clr8);
                    346: TME_M68K_INSN_DECL(tme_m68k_negx8);
                    347: TME_M68K_INSN_DECL(tme_m68k_addx8);
                    348: TME_M68K_INSN_DECL(tme_m68k_subx8);
                    349: TME_M68K_INSN_DECL(tme_m68k_cmpm8);
                    350: TME_M68K_INSN_DECL(tme_m68k_btst8);
                    351: TME_M68K_INSN_DECL(tme_m68k_bchg8);
                    352: TME_M68K_INSN_DECL(tme_m68k_bclr8);
                    353: TME_M68K_INSN_DECL(tme_m68k_bset8);
                    354: TME_M68K_INSN_DECL(tme_m68k_asl8);
                    355: TME_M68K_INSN_DECL(tme_m68k_asr8);
                    356: TME_M68K_INSN_DECL(tme_m68k_lsl8);
                    357: TME_M68K_INSN_DECL(tme_m68k_lsr8);
                    358: TME_M68K_INSN_DECL(tme_m68k_rol8);
                    359: TME_M68K_INSN_DECL(tme_m68k_ror8);
                    360: TME_M68K_INSN_DECL(tme_m68k_roxl8);
                    361: TME_M68K_INSN_DECL(tme_m68k_roxr8);
                    362: TME_M68K_INSN_DECL(tme_m68k_cas8);
                    363: TME_M68K_INSN_DECL(tme_m68k_moves8);
                    364: TME_M68K_INSN_DECL(tme_m68k_add16);
                    365: TME_M68K_INSN_DECL(tme_m68k_sub16);
                    366: TME_M68K_INSN_DECL(tme_m68k_cmp16);
                    367: TME_M68K_INSN_DECL(tme_m68k_neg16);
                    368: TME_M68K_INSN_DECL(tme_m68k_or16);
                    369: TME_M68K_INSN_DECL(tme_m68k_and16);
                    370: TME_M68K_INSN_DECL(tme_m68k_eor16);
                    371: TME_M68K_INSN_DECL(tme_m68k_not16);
                    372: TME_M68K_INSN_DECL(tme_m68k_tst16);
                    373: TME_M68K_INSN_DECL(tme_m68k_move16);
                    374: TME_M68K_INSN_DECL(tme_m68k_clr16);
                    375: TME_M68K_INSN_DECL(tme_m68k_cmpa16);
                    376: TME_M68K_INSN_DECL(tme_m68k_negx16);
                    377: TME_M68K_INSN_DECL(tme_m68k_addx16);
                    378: TME_M68K_INSN_DECL(tme_m68k_subx16);
                    379: TME_M68K_INSN_DECL(tme_m68k_cmpm16);
                    380: TME_M68K_INSN_DECL(tme_m68k_suba16);
                    381: TME_M68K_INSN_DECL(tme_m68k_adda16);
                    382: TME_M68K_INSN_DECL(tme_m68k_movea16);
                    383: TME_M68K_INSN_DECL(tme_m68k_asl16);
                    384: TME_M68K_INSN_DECL(tme_m68k_asr16);
                    385: TME_M68K_INSN_DECL(tme_m68k_lsl16);
                    386: TME_M68K_INSN_DECL(tme_m68k_lsr16);
                    387: TME_M68K_INSN_DECL(tme_m68k_rol16);
                    388: TME_M68K_INSN_DECL(tme_m68k_ror16);
                    389: TME_M68K_INSN_DECL(tme_m68k_roxl16);
                    390: TME_M68K_INSN_DECL(tme_m68k_roxr16);
                    391: TME_M68K_INSN_DECL(tme_m68k_movep_rm16);
                    392: TME_M68K_INSN_DECL(tme_m68k_movem_rm16);
                    393: TME_M68K_INSN_DECL(tme_m68k_movep_mr16);
                    394: TME_M68K_INSN_DECL(tme_m68k_movem_mr16);
                    395: TME_M68K_INSN_DECL(tme_m68k_chk16);
                    396: TME_M68K_INSN_DECL(tme_m68k_cas16);
                    397: TME_M68K_INSN_DECL(tme_m68k_cas2_16);
                    398: TME_M68K_INSN_DECL(tme_m68k_moves16);
                    399: TME_M68K_INSN_DECL(tme_m68k_add32);
                    400: TME_M68K_INSN_DECL(tme_m68k_sub32);
                    401: TME_M68K_INSN_DECL(tme_m68k_cmp32);
                    402: TME_M68K_INSN_DECL(tme_m68k_neg32);
                    403: TME_M68K_INSN_DECL(tme_m68k_or32);
                    404: TME_M68K_INSN_DECL(tme_m68k_and32);
                    405: TME_M68K_INSN_DECL(tme_m68k_eor32);
                    406: TME_M68K_INSN_DECL(tme_m68k_not32);
                    407: TME_M68K_INSN_DECL(tme_m68k_tst32);
                    408: TME_M68K_INSN_DECL(tme_m68k_move32);
                    409: TME_M68K_INSN_DECL(tme_m68k_moveq32);
                    410: TME_M68K_INSN_DECL(tme_m68k_clr32);
                    411: TME_M68K_INSN_DECL(tme_m68k_negx32);
                    412: TME_M68K_INSN_DECL(tme_m68k_addx32);
                    413: TME_M68K_INSN_DECL(tme_m68k_subx32);
                    414: TME_M68K_INSN_DECL(tme_m68k_cmpm32);
                    415: TME_M68K_INSN_DECL(tme_m68k_suba32);
                    416: TME_M68K_INSN_DECL(tme_m68k_adda32);
                    417: TME_M68K_INSN_DECL(tme_m68k_movea32);
                    418: TME_M68K_INSN_DECL(tme_m68k_btst32);
                    419: TME_M68K_INSN_DECL(tme_m68k_bchg32);
                    420: TME_M68K_INSN_DECL(tme_m68k_bclr32);
                    421: TME_M68K_INSN_DECL(tme_m68k_bset32);
                    422: TME_M68K_INSN_DECL(tme_m68k_asl32);
                    423: TME_M68K_INSN_DECL(tme_m68k_asr32);
                    424: TME_M68K_INSN_DECL(tme_m68k_lsl32);
                    425: TME_M68K_INSN_DECL(tme_m68k_lsr32);
                    426: TME_M68K_INSN_DECL(tme_m68k_rol32);
                    427: TME_M68K_INSN_DECL(tme_m68k_ror32);
                    428: TME_M68K_INSN_DECL(tme_m68k_roxl32);
                    429: TME_M68K_INSN_DECL(tme_m68k_roxr32);
                    430: TME_M68K_INSN_DECL(tme_m68k_movep_rm32);
                    431: TME_M68K_INSN_DECL(tme_m68k_movem_rm32);
                    432: TME_M68K_INSN_DECL(tme_m68k_movep_mr32);
                    433: TME_M68K_INSN_DECL(tme_m68k_movem_mr32);
                    434: TME_M68K_INSN_DECL(tme_m68k_chk32);
                    435: TME_M68K_INSN_DECL(tme_m68k_cas32);
                    436: TME_M68K_INSN_DECL(tme_m68k_cas2_32);
                    437: TME_M68K_INSN_DECL(tme_m68k_moves32);
                    438: void tme_m68k_read_memx8 _TME_P((struct tme_m68k *));
                    439: void tme_m68k_read_mem8 _TME_P((struct tme_m68k *, int));
                    440: #define tme_m68k_read8(ic, t, fc, la, _v, f) \
                    441:   tme_m68k_read(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint8_t), f)
                    442: void tme_m68k_write_memx8 _TME_P((struct tme_m68k *));
                    443: void tme_m68k_write_mem8 _TME_P((struct tme_m68k *, int));
                    444: #define tme_m68k_write8(ic, t, fc, la, _v, f) \
                    445:   tme_m68k_write(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint8_t), f)
                    446: void tme_m68k_read_memx16 _TME_P((struct tme_m68k *));
                    447: void tme_m68k_read_mem16 _TME_P((struct tme_m68k *, int));
                    448: tme_uint16_t tme_m68k_fetch16 _TME_P((struct tme_m68k *, tme_uint32_t));
                    449: void tme_m68k_pop16 _TME_P((struct tme_m68k *, tme_uint16_t *));
                    450: #define tme_m68k_read16(ic, t, fc, la, _v, f) \
                    451:   tme_m68k_read(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint16_t), f)
                    452: void tme_m68k_write_memx16 _TME_P((struct tme_m68k *));
                    453: void tme_m68k_write_mem16 _TME_P((struct tme_m68k *, int));
                    454: void tme_m68k_push16 _TME_P((struct tme_m68k *, tme_uint16_t ));
                    455: #define tme_m68k_write16(ic, t, fc, la, _v, f) \
                    456:   tme_m68k_write(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint16_t), f)
                    457: void tme_m68k_read_memx32 _TME_P((struct tme_m68k *));
                    458: void tme_m68k_read_mem32 _TME_P((struct tme_m68k *, int));
                    459: tme_uint32_t tme_m68k_fetch32 _TME_P((struct tme_m68k *, tme_uint32_t));
                    460: void tme_m68k_pop32 _TME_P((struct tme_m68k *, tme_uint32_t *));
                    461: #define tme_m68k_read32(ic, t, fc, la, _v, f) \
                    462:   tme_m68k_read(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint32_t), f)
                    463: void tme_m68k_write_memx32 _TME_P((struct tme_m68k *));
                    464: void tme_m68k_write_mem32 _TME_P((struct tme_m68k *, int));
                    465: void tme_m68k_push32 _TME_P((struct tme_m68k *, tme_uint32_t ));
                    466: #define tme_m68k_write32(ic, t, fc, la, _v, f) \
                    467:   tme_m68k_write(ic, t, fc, la, (tme_uint8_t *) (_v), sizeof(tme_uint32_t), f)
                    468: void tme_m68k_read_mem _TME_P((struct tme_m68k *, tme_uint8_t *, unsigned int));
                    469: void tme_m68k_read _TME_P((struct tme_m68k *, struct tme_m68k_tlb *, unsigned int *, tme_uint32_t *, tme_uint8_t *, unsigned int, unsigned int));
                    470: void tme_m68k_write_mem _TME_P((struct tme_m68k *, tme_uint8_t *, unsigned int));
                    471: void tme_m68k_write _TME_P((struct tme_m68k *, struct tme_m68k_tlb *, unsigned int *, tme_uint32_t *, tme_uint8_t *, unsigned int, unsigned int));
                    472: TME_M68K_INSN_DECL(tme_m68k_abcd);
                    473: TME_M68K_INSN_DECL(tme_m68k_sbcd);
                    474: TME_M68K_INSN_DECL(tme_m68k_nbcd);
                    475: TME_M68K_INSN_DECL(tme_m68k_ori_ccr);
                    476: TME_M68K_INSN_DECL(tme_m68k_andi_ccr);
                    477: TME_M68K_INSN_DECL(tme_m68k_eori_ccr);
                    478: TME_M68K_INSN_DECL(tme_m68k_move_to_ccr);
                    479: TME_M68K_INSN_DECL(tme_m68k_ori_sr);
                    480: TME_M68K_INSN_DECL(tme_m68k_andi_sr);
                    481: TME_M68K_INSN_DECL(tme_m68k_eori_sr);
                    482: TME_M68K_INSN_DECL(tme_m68k_move_to_sr);
                    483: TME_M68K_INSN_DECL(tme_m68k_mulu);
                    484: TME_M68K_INSN_DECL(tme_m68k_divu);
                    485: TME_M68K_INSN_DECL(tme_m68k_mulul);
                    486: TME_M68K_INSN_DECL(tme_m68k_divul);
                    487: TME_M68K_INSN_DECL(tme_m68k_muls);
                    488: TME_M68K_INSN_DECL(tme_m68k_divs);
                    489: TME_M68K_INSN_DECL(tme_m68k_mulsl);
                    490: TME_M68K_INSN_DECL(tme_m68k_divsl);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.