Commit d26bc2118e99702eb8c1bb240786bcadd7fa21ac
1 parent
5850586c
Clean out the N32 macros from target-mips, and introduce MIPS ABI specific
defines for linux-user. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3556 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
13 changed files
with
75 additions
and
73 deletions
configure
| @@ -1099,16 +1099,18 @@ elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then | @@ -1099,16 +1099,18 @@ elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then | ||
| 1099 | echo "TARGET_ARCH=mips" >> $config_mak | 1099 | echo "TARGET_ARCH=mips" >> $config_mak |
| 1100 | echo "#define TARGET_ARCH \"mips\"" >> $config_h | 1100 | echo "#define TARGET_ARCH \"mips\"" >> $config_h |
| 1101 | echo "#define TARGET_MIPS 1" >> $config_h | 1101 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1102 | + echo "#define TARGET_ABI_MIPSO32 1" >> $config_h | ||
| 1102 | elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then | 1103 | elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then |
| 1103 | echo "TARGET_ARCH=mipsn32" >> $config_mak | 1104 | echo "TARGET_ARCH=mipsn32" >> $config_mak |
| 1104 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h | 1105 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h |
| 1105 | echo "#define TARGET_MIPS 1" >> $config_h | 1106 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1106 | - echo "#define TARGET_MIPSN32 1" >> $config_h | 1107 | + echo "#define TARGET_ABI_MIPSN32 1" >> $config_h |
| 1107 | elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then | 1108 | elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then |
| 1108 | echo "TARGET_ARCH=mips64" >> $config_mak | 1109 | echo "TARGET_ARCH=mips64" >> $config_mak |
| 1109 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h | 1110 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h |
| 1110 | echo "#define TARGET_MIPS 1" >> $config_h | 1111 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1111 | echo "#define TARGET_MIPS64 1" >> $config_h | 1112 | echo "#define TARGET_MIPS64 1" >> $config_h |
| 1113 | + echo "#define TARGET_ABI_MIPSN64 1" >> $config_h | ||
| 1112 | elif test "$target_cpu" = "cris" ; then | 1114 | elif test "$target_cpu" = "cris" ; then |
| 1113 | echo "TARGET_ARCH=cris" >> $config_mak | 1115 | echo "TARGET_ARCH=cris" >> $config_mak |
| 1114 | echo "#define TARGET_ARCH \"cris\"" >> $config_h | 1116 | echo "#define TARGET_ARCH \"cris\"" >> $config_h |
linux-user/main.c
| @@ -2225,7 +2225,7 @@ int main(int argc, char **argv) | @@ -2225,7 +2225,7 @@ int main(int argc, char **argv) | ||
| 2225 | 2225 | ||
| 2226 | /* Choose and initialise CPU */ | 2226 | /* Choose and initialise CPU */ |
| 2227 | if (cpu_model == NULL) | 2227 | if (cpu_model == NULL) |
| 2228 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 2228 | +#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64) |
| 2229 | cpu_model = "20Kc"; | 2229 | cpu_model = "20Kc"; |
| 2230 | #else | 2230 | #else |
| 2231 | cpu_model = "24Kf"; | 2231 | cpu_model = "24Kf"; |
linux-user/signal.c
| @@ -1939,7 +1939,7 @@ void sparc64_get_context(CPUSPARCState *env) | @@ -1939,7 +1939,7 @@ void sparc64_get_context(CPUSPARCState *env) | ||
| 1939 | force_sig(SIGSEGV); | 1939 | force_sig(SIGSEGV); |
| 1940 | } | 1940 | } |
| 1941 | #endif | 1941 | #endif |
| 1942 | -#elif defined(TARGET_MIPS64) | 1942 | +#elif defined(TARGET_ABI_MIPSN64) |
| 1943 | 1943 | ||
| 1944 | # warning signal handling not implemented | 1944 | # warning signal handling not implemented |
| 1945 | 1945 | ||
| @@ -1968,7 +1968,7 @@ long do_rt_sigreturn(CPUState *env) | @@ -1968,7 +1968,7 @@ long do_rt_sigreturn(CPUState *env) | ||
| 1968 | return -ENOSYS; | 1968 | return -ENOSYS; |
| 1969 | } | 1969 | } |
| 1970 | 1970 | ||
| 1971 | -#elif defined(TARGET_MIPSN32) | 1971 | +#elif defined(TARGET_ABI_MIPSN32) |
| 1972 | 1972 | ||
| 1973 | # warning signal handling not implemented | 1973 | # warning signal handling not implemented |
| 1974 | 1974 | ||
| @@ -1997,7 +1997,7 @@ long do_rt_sigreturn(CPUState *env) | @@ -1997,7 +1997,7 @@ long do_rt_sigreturn(CPUState *env) | ||
| 1997 | return -ENOSYS; | 1997 | return -ENOSYS; |
| 1998 | } | 1998 | } |
| 1999 | 1999 | ||
| 2000 | -#elif defined(TARGET_MIPS) | 2000 | +#elif defined(TARGET_ABI_MIPSO32) |
| 2001 | 2001 | ||
| 2002 | struct target_sigcontext { | 2002 | struct target_sigcontext { |
| 2003 | uint32_t sc_regmask; /* Unused */ | 2003 | uint32_t sc_regmask; /* Unused */ |
linux-user/syscall_defs.h
| @@ -307,8 +307,8 @@ int do_sigaction(int sig, const struct target_sigaction *act, | @@ -307,8 +307,8 @@ int do_sigaction(int sig, const struct target_sigaction *act, | ||
| 307 | #define TARGET_SA_NODEFER 0x40000000 | 307 | #define TARGET_SA_NODEFER 0x40000000 |
| 308 | #define TARGET_SA_RESTART 0x10000000 | 308 | #define TARGET_SA_RESTART 0x10000000 |
| 309 | #define TARGET_SA_RESETHAND 0x80000000 | 309 | #define TARGET_SA_RESETHAND 0x80000000 |
| 310 | -#if !defined(TARGET_MIPSN32) && !defined(TARGET_MIPS64) | ||
| 311 | -#define TARGET_SA_RESTORER 0x04000000 /* Only for o32 */ | 310 | +#if !defined(TARGET_ABI_MIPSN32) && !defined(TARGET_ABI_MIPSN64) |
| 311 | +#define TARGET_SA_RESTORER 0x04000000 /* Only for O32 */ | ||
| 312 | #endif | 312 | #endif |
| 313 | #else | 313 | #else |
| 314 | #define TARGET_SA_NOCLDSTOP 0x00000001 | 314 | #define TARGET_SA_NOCLDSTOP 0x00000001 |
| @@ -450,7 +450,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, | @@ -450,7 +450,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, | ||
| 450 | 450 | ||
| 451 | struct target_sigaction { | 451 | struct target_sigaction { |
| 452 | uint32_t sa_flags; | 452 | uint32_t sa_flags; |
| 453 | -#if defined(TARGET_MIPSN32) | 453 | +#if defined(TARGET_ABI_MIPSN32) |
| 454 | uint32_t _sa_handler; | 454 | uint32_t _sa_handler; |
| 455 | #else | 455 | #else |
| 456 | abi_ulong _sa_handler; | 456 | abi_ulong _sa_handler; |
| @@ -1194,7 +1194,7 @@ struct target_stat64 { | @@ -1194,7 +1194,7 @@ struct target_stat64 { | ||
| 1194 | unsigned long long st_ino; | 1194 | unsigned long long st_ino; |
| 1195 | } __attribute__((packed)); | 1195 | } __attribute__((packed)); |
| 1196 | 1196 | ||
| 1197 | -#elif defined(TARGET_MIPS64) | 1197 | +#elif defined(TARGET_ABI_MIPSN64) |
| 1198 | 1198 | ||
| 1199 | /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ | 1199 | /* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ |
| 1200 | struct target_stat { | 1200 | struct target_stat { |
| @@ -1233,7 +1233,7 @@ struct target_stat { | @@ -1233,7 +1233,7 @@ struct target_stat { | ||
| 1233 | abi_ulong st_blocks; | 1233 | abi_ulong st_blocks; |
| 1234 | }; | 1234 | }; |
| 1235 | 1235 | ||
| 1236 | -#elif defined(TARGET_MIPSN32) | 1236 | +#elif defined(TARGET_ABI_MIPSN32) |
| 1237 | 1237 | ||
| 1238 | struct target_stat { | 1238 | struct target_stat { |
| 1239 | unsigned st_dev; | 1239 | unsigned st_dev; |
| @@ -1304,7 +1304,7 @@ struct target_stat64 { | @@ -1304,7 +1304,7 @@ struct target_stat64 { | ||
| 1304 | int st_blocks; | 1304 | int st_blocks; |
| 1305 | }; | 1305 | }; |
| 1306 | 1306 | ||
| 1307 | -#elif defined(TARGET_MIPS) | 1307 | +#elif defined(TARGET_ABI_MIPSO32) |
| 1308 | 1308 | ||
| 1309 | struct target_stat { | 1309 | struct target_stat { |
| 1310 | unsigned st_dev; | 1310 | unsigned st_dev; |
| @@ -1486,7 +1486,7 @@ typedef struct { | @@ -1486,7 +1486,7 @@ typedef struct { | ||
| 1486 | } target_fsid_t; | 1486 | } target_fsid_t; |
| 1487 | 1487 | ||
| 1488 | #ifdef TARGET_MIPS | 1488 | #ifdef TARGET_MIPS |
| 1489 | -#ifdef TARGET_MIPSN32 | 1489 | +#ifdef TARGET_ABI_MIPSN32 |
| 1490 | struct target_statfs { | 1490 | struct target_statfs { |
| 1491 | int32_t f_type; | 1491 | int32_t f_type; |
| 1492 | int32_t f_bsize; | 1492 | int32_t f_bsize; |
target-mips/exec.h
| @@ -56,7 +56,7 @@ register target_ulong T2 asm(AREG3); | @@ -56,7 +56,7 @@ register target_ulong T2 asm(AREG3); | ||
| 56 | #include "softmmu_exec.h" | 56 | #include "softmmu_exec.h" |
| 57 | #endif /* !defined(CONFIG_USER_ONLY) */ | 57 | #endif /* !defined(CONFIG_USER_ONLY) */ |
| 58 | 58 | ||
| 59 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 59 | +#if defined(TARGET_MIPS64) |
| 60 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 60 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| 61 | void do_dsll (void); | 61 | void do_dsll (void); |
| 62 | void do_dsll32 (void); | 62 | void do_dsll32 (void); |
| @@ -86,7 +86,7 @@ void do_maddu (void); | @@ -86,7 +86,7 @@ void do_maddu (void); | ||
| 86 | void do_msub (void); | 86 | void do_msub (void); |
| 87 | void do_msubu (void); | 87 | void do_msubu (void); |
| 88 | #endif | 88 | #endif |
| 89 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 89 | +#if defined(TARGET_MIPS64) |
| 90 | void do_ddiv (void); | 90 | void do_ddiv (void); |
| 91 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 91 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| 92 | void do_ddivu (void); | 92 | void do_ddivu (void); |
| @@ -236,7 +236,7 @@ static always_inline void compute_hflags(CPUState *env) | @@ -236,7 +236,7 @@ static always_inline void compute_hflags(CPUState *env) | ||
| 236 | !(env->hflags & MIPS_HFLAG_DM)) { | 236 | !(env->hflags & MIPS_HFLAG_DM)) { |
| 237 | env->hflags |= (env->CP0_Status >> CP0St_KSU) & MIPS_HFLAG_KSU; | 237 | env->hflags |= (env->CP0_Status >> CP0St_KSU) & MIPS_HFLAG_KSU; |
| 238 | } | 238 | } |
| 239 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 239 | +#if defined(TARGET_MIPS64) |
| 240 | if (((env->hflags & MIPS_HFLAG_KSU) != MIPS_HFLAG_UM) || | 240 | if (((env->hflags & MIPS_HFLAG_KSU) != MIPS_HFLAG_UM) || |
| 241 | (env->CP0_Status & (1 << CP0St_PX)) || | 241 | (env->CP0_Status & (1 << CP0St_PX)) || |
| 242 | (env->CP0_Status & (1 << CP0St_UX))) | 242 | (env->CP0_Status & (1 << CP0St_UX))) |
target-mips/helper.c
| @@ -76,7 +76,7 @@ int r4k_map_address (CPUState *env, target_ulong *physical, int *prot, | @@ -76,7 +76,7 @@ int r4k_map_address (CPUState *env, target_ulong *physical, int *prot, | ||
| 76 | target_ulong mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); | 76 | target_ulong mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); |
| 77 | target_ulong tag = address & ~mask; | 77 | target_ulong tag = address & ~mask; |
| 78 | target_ulong VPN = tlb->VPN & ~mask; | 78 | target_ulong VPN = tlb->VPN & ~mask; |
| 79 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 79 | +#if defined(TARGET_MIPS64) |
| 80 | tag &= env->SEGMask; | 80 | tag &= env->SEGMask; |
| 81 | #endif | 81 | #endif |
| 82 | 82 | ||
| @@ -108,7 +108,7 @@ static int get_physical_address (CPUState *env, target_ulong *physical, | @@ -108,7 +108,7 @@ static int get_physical_address (CPUState *env, target_ulong *physical, | ||
| 108 | int user_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_UM; | 108 | int user_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_UM; |
| 109 | int supervisor_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_SM; | 109 | int supervisor_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_SM; |
| 110 | int kernel_mode = !user_mode && !supervisor_mode; | 110 | int kernel_mode = !user_mode && !supervisor_mode; |
| 111 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 111 | +#if defined(TARGET_MIPS64) |
| 112 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; | 112 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
| 113 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; | 113 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
| 114 | int KX = (env->CP0_Status & (1 << CP0St_KX)) != 0; | 114 | int KX = (env->CP0_Status & (1 << CP0St_KX)) != 0; |
| @@ -130,7 +130,7 @@ static int get_physical_address (CPUState *env, target_ulong *physical, | @@ -130,7 +130,7 @@ static int get_physical_address (CPUState *env, target_ulong *physical, | ||
| 130 | } else { | 130 | } else { |
| 131 | ret = env->tlb->map_address(env, physical, prot, address, rw, access_type); | 131 | ret = env->tlb->map_address(env, physical, prot, address, rw, access_type); |
| 132 | } | 132 | } |
| 133 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 133 | +#if defined(TARGET_MIPS64) |
| 134 | } else if (address < 0x4000000000000000ULL) { | 134 | } else if (address < 0x4000000000000000ULL) { |
| 135 | /* xuseg */ | 135 | /* xuseg */ |
| 136 | if (UX && address < (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { | 136 | if (UX && address < (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { |
| @@ -305,7 +305,7 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, | @@ -305,7 +305,7 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, | ||
| 305 | ((address >> 9) & 0x007ffff0); | 305 | ((address >> 9) & 0x007ffff0); |
| 306 | env->CP0_EntryHi = | 306 | env->CP0_EntryHi = |
| 307 | (env->CP0_EntryHi & 0xFF) | (address & (TARGET_PAGE_MASK << 1)); | 307 | (env->CP0_EntryHi & 0xFF) | (address & (TARGET_PAGE_MASK << 1)); |
| 308 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 308 | +#if defined(TARGET_MIPS64) |
| 309 | env->CP0_EntryHi &= env->SEGMask; | 309 | env->CP0_EntryHi &= env->SEGMask; |
| 310 | env->CP0_XContext = (env->CP0_XContext & ((~0ULL) << (env->SEGBITS - 7))) | | 310 | env->CP0_XContext = (env->CP0_XContext & ((~0ULL) << (env->SEGBITS - 7))) | |
| 311 | ((address & 0xC00000000000ULL) >> (env->SEGBITS - 9)) | | 311 | ((address & 0xC00000000000ULL) >> (env->SEGBITS - 9)) | |
| @@ -425,7 +425,7 @@ void do_interrupt (CPUState *env) | @@ -425,7 +425,7 @@ void do_interrupt (CPUState *env) | ||
| 425 | case EXCP_TLBL: | 425 | case EXCP_TLBL: |
| 426 | cause = 2; | 426 | cause = 2; |
| 427 | if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { | 427 | if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { |
| 428 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 428 | +#if defined(TARGET_MIPS64) |
| 429 | int R = env->CP0_BadVAddr >> 62; | 429 | int R = env->CP0_BadVAddr >> 62; |
| 430 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; | 430 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
| 431 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; | 431 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
| @@ -473,7 +473,7 @@ void do_interrupt (CPUState *env) | @@ -473,7 +473,7 @@ void do_interrupt (CPUState *env) | ||
| 473 | case EXCP_TLBS: | 473 | case EXCP_TLBS: |
| 474 | cause = 3; | 474 | cause = 3; |
| 475 | if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { | 475 | if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { |
| 476 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 476 | +#if defined(TARGET_MIPS64) |
| 477 | int R = env->CP0_BadVAddr >> 62; | 477 | int R = env->CP0_BadVAddr >> 62; |
| 478 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; | 478 | int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
| 479 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; | 479 | int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
| @@ -559,7 +559,7 @@ void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra) | @@ -559,7 +559,7 @@ void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra) | ||
| 559 | mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); | 559 | mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); |
| 560 | if (tlb->V0) { | 560 | if (tlb->V0) { |
| 561 | addr = tlb->VPN & ~mask; | 561 | addr = tlb->VPN & ~mask; |
| 562 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 562 | +#if defined(TARGET_MIPS64) |
| 563 | if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { | 563 | if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { |
| 564 | addr |= 0x3FFFFF0000000000ULL; | 564 | addr |= 0x3FFFFF0000000000ULL; |
| 565 | } | 565 | } |
| @@ -572,7 +572,7 @@ void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra) | @@ -572,7 +572,7 @@ void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra) | ||
| 572 | } | 572 | } |
| 573 | if (tlb->V1) { | 573 | if (tlb->V1) { |
| 574 | addr = (tlb->VPN & ~mask) | ((mask >> 1) + 1); | 574 | addr = (tlb->VPN & ~mask) | ((mask >> 1) + 1); |
| 575 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 575 | +#if defined(TARGET_MIPS64) |
| 576 | if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { | 576 | if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { |
| 577 | addr |= 0x3FFFFF0000000000ULL; | 577 | addr |= 0x3FFFFF0000000000ULL; |
| 578 | } | 578 | } |
target-mips/mips-defs.h
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | #define TARGET_PAGE_BITS 12 | 8 | #define TARGET_PAGE_BITS 12 |
| 9 | #define MIPS_TLB_MAX 128 | 9 | #define MIPS_TLB_MAX 128 |
| 10 | 10 | ||
| 11 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 11 | +#if defined(TARGET_MIPS64) |
| 12 | #define TARGET_LONG_BITS 64 | 12 | #define TARGET_LONG_BITS 64 |
| 13 | #else | 13 | #else |
| 14 | #define TARGET_LONG_BITS 32 | 14 | #define TARGET_LONG_BITS 32 |
target-mips/op.c
| @@ -301,7 +301,7 @@ void op_addr_add (void) | @@ -301,7 +301,7 @@ void op_addr_add (void) | ||
| 301 | /* For compatibility with 32-bit code, data reference in user mode | 301 | /* For compatibility with 32-bit code, data reference in user mode |
| 302 | with Status_UX = 0 should be casted to 32-bit and sign extended. | 302 | with Status_UX = 0 should be casted to 32-bit and sign extended. |
| 303 | See the MIPS64 PRA manual, section 4.10. */ | 303 | See the MIPS64 PRA manual, section 4.10. */ |
| 304 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 304 | +#if defined(TARGET_MIPS64) |
| 305 | if (((env->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) && | 305 | if (((env->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) && |
| 306 | !(env->CP0_Status & (1 << CP0St_UX))) | 306 | !(env->CP0_Status & (1 << CP0St_UX))) |
| 307 | T0 = (int64_t)(int32_t)(T0 + T1); | 307 | T0 = (int64_t)(int32_t)(T0 + T1); |
| @@ -384,7 +384,7 @@ void op_divu (void) | @@ -384,7 +384,7 @@ void op_divu (void) | ||
| 384 | RETURN(); | 384 | RETURN(); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 387 | +#if defined(TARGET_MIPS64) |
| 388 | /* Arithmetic */ | 388 | /* Arithmetic */ |
| 389 | void op_dadd (void) | 389 | void op_dadd (void) |
| 390 | { | 390 | { |
| @@ -453,7 +453,7 @@ void op_ddivu (void) | @@ -453,7 +453,7 @@ void op_ddivu (void) | ||
| 453 | RETURN(); | 453 | RETURN(); |
| 454 | } | 454 | } |
| 455 | #endif | 455 | #endif |
| 456 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 456 | +#endif /* TARGET_MIPS64 */ |
| 457 | 457 | ||
| 458 | /* Logical */ | 458 | /* Logical */ |
| 459 | void op_and (void) | 459 | void op_and (void) |
| @@ -552,7 +552,7 @@ void op_clz (void) | @@ -552,7 +552,7 @@ void op_clz (void) | ||
| 552 | RETURN(); | 552 | RETURN(); |
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 555 | +#if defined(TARGET_MIPS64) |
| 556 | 556 | ||
| 557 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 557 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| 558 | /* Those might call libgcc functions. */ | 558 | /* Those might call libgcc functions. */ |
| @@ -743,7 +743,7 @@ void op_dclz (void) | @@ -743,7 +743,7 @@ void op_dclz (void) | ||
| 743 | RETURN(); | 743 | RETURN(); |
| 744 | } | 744 | } |
| 745 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ | 745 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ |
| 746 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 746 | +#endif /* TARGET_MIPS64 */ |
| 747 | 747 | ||
| 748 | /* 64 bits arithmetic */ | 748 | /* 64 bits arithmetic */ |
| 749 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 749 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| @@ -846,7 +846,7 @@ void op_msubu (void) | @@ -846,7 +846,7 @@ void op_msubu (void) | ||
| 846 | } | 846 | } |
| 847 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ | 847 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ |
| 848 | 848 | ||
| 849 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 849 | +#if defined(TARGET_MIPS64) |
| 850 | void op_dmult (void) | 850 | void op_dmult (void) |
| 851 | { | 851 | { |
| 852 | CALL_FROM_TB4(muls64, &(env->LO[0][env->current_tc]), &(env->HI[0][env->current_tc]), T0, T1); | 852 | CALL_FROM_TB4(muls64, &(env->LO[0][env->current_tc]), &(env->HI[0][env->current_tc]), T0, T1); |
| @@ -950,7 +950,7 @@ void op_save_btarget (void) | @@ -950,7 +950,7 @@ void op_save_btarget (void) | ||
| 950 | RETURN(); | 950 | RETURN(); |
| 951 | } | 951 | } |
| 952 | 952 | ||
| 953 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 953 | +#if defined(TARGET_MIPS64) |
| 954 | void op_save_btarget64 (void) | 954 | void op_save_btarget64 (void) |
| 955 | { | 955 | { |
| 956 | env->btarget = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; | 956 | env->btarget = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; |
| @@ -1784,7 +1784,7 @@ void op_mtc0_entryhi (void) | @@ -1784,7 +1784,7 @@ void op_mtc0_entryhi (void) | ||
| 1784 | 1784 | ||
| 1785 | /* 1k pages not implemented */ | 1785 | /* 1k pages not implemented */ |
| 1786 | val = T0 & ((TARGET_PAGE_MASK << 1) | 0xFF); | 1786 | val = T0 & ((TARGET_PAGE_MASK << 1) | 0xFF); |
| 1787 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1787 | +#if defined(TARGET_MIPS64) |
| 1788 | val &= env->SEGMask; | 1788 | val &= env->SEGMask; |
| 1789 | #endif | 1789 | #endif |
| 1790 | old = env->CP0_EntryHi; | 1790 | old = env->CP0_EntryHi; |
| @@ -2011,7 +2011,7 @@ void op_mtc0_desave (void) | @@ -2011,7 +2011,7 @@ void op_mtc0_desave (void) | ||
| 2011 | RETURN(); | 2011 | RETURN(); |
| 2012 | } | 2012 | } |
| 2013 | 2013 | ||
| 2014 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 2014 | +#if defined(TARGET_MIPS64) |
| 2015 | void op_dmfc0_yqmask (void) | 2015 | void op_dmfc0_yqmask (void) |
| 2016 | { | 2016 | { |
| 2017 | T0 = env->CP0_YQMask; | 2017 | T0 = env->CP0_YQMask; |
| @@ -2125,7 +2125,7 @@ void op_dmfc0_errorepc (void) | @@ -2125,7 +2125,7 @@ void op_dmfc0_errorepc (void) | ||
| 2125 | T0 = env->CP0_ErrorEPC; | 2125 | T0 = env->CP0_ErrorEPC; |
| 2126 | RETURN(); | 2126 | RETURN(); |
| 2127 | } | 2127 | } |
| 2128 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 2128 | +#endif /* TARGET_MIPS64 */ |
| 2129 | 2129 | ||
| 2130 | /* MIPS MT functions */ | 2130 | /* MIPS MT functions */ |
| 2131 | void op_mftgpr(void) | 2131 | void op_mftgpr(void) |
| @@ -3039,7 +3039,7 @@ void op_save_pc (void) | @@ -3039,7 +3039,7 @@ void op_save_pc (void) | ||
| 3039 | RETURN(); | 3039 | RETURN(); |
| 3040 | } | 3040 | } |
| 3041 | 3041 | ||
| 3042 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 3042 | +#if defined(TARGET_MIPS64) |
| 3043 | void op_save_pc64 (void) | 3043 | void op_save_pc64 (void) |
| 3044 | { | 3044 | { |
| 3045 | env->PC[env->current_tc] = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; | 3045 | env->PC[env->current_tc] = ((uint64_t)PARAM1 << 32) | (uint32_t)PARAM2; |
| @@ -3111,7 +3111,7 @@ void op_wsbh(void) | @@ -3111,7 +3111,7 @@ void op_wsbh(void) | ||
| 3111 | RETURN(); | 3111 | RETURN(); |
| 3112 | } | 3112 | } |
| 3113 | 3113 | ||
| 3114 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 3114 | +#if defined(TARGET_MIPS64) |
| 3115 | void op_dext(void) | 3115 | void op_dext(void) |
| 3116 | { | 3116 | { |
| 3117 | unsigned int pos = PARAM1; | 3117 | unsigned int pos = PARAM1; |
target-mips/op_helper.c
| @@ -68,7 +68,7 @@ void do_raise_exception_direct (uint32_t exception) | @@ -68,7 +68,7 @@ void do_raise_exception_direct (uint32_t exception) | ||
| 68 | do_raise_exception_direct_err (exception, 0); | 68 | do_raise_exception_direct_err (exception, 0); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 71 | +#if defined(TARGET_MIPS64) |
| 72 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 72 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| 73 | /* Those might call libgcc functions. */ | 73 | /* Those might call libgcc functions. */ |
| 74 | void do_dsll (void) | 74 | void do_dsll (void) |
| @@ -159,7 +159,7 @@ void do_dclz (void) | @@ -159,7 +159,7 @@ void do_dclz (void) | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ | 161 | #endif /* TARGET_LONG_BITS > HOST_LONG_BITS */ |
| 162 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 162 | +#endif /* TARGET_MIPS64 */ |
| 163 | 163 | ||
| 164 | /* 64 bits arithmetic for 32 bits hosts */ | 164 | /* 64 bits arithmetic for 32 bits hosts */ |
| 165 | #if TARGET_LONG_BITS > HOST_LONG_BITS | 165 | #if TARGET_LONG_BITS > HOST_LONG_BITS |
| @@ -228,7 +228,7 @@ void do_div (void) | @@ -228,7 +228,7 @@ void do_div (void) | ||
| 228 | } | 228 | } |
| 229 | #endif | 229 | #endif |
| 230 | 230 | ||
| 231 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 231 | +#if defined(TARGET_MIPS64) |
| 232 | void do_ddiv (void) | 232 | void do_ddiv (void) |
| 233 | { | 233 | { |
| 234 | if (T1 != 0) { | 234 | if (T1 != 0) { |
| @@ -247,7 +247,7 @@ void do_ddivu (void) | @@ -247,7 +247,7 @@ void do_ddivu (void) | ||
| 247 | } | 247 | } |
| 248 | } | 248 | } |
| 249 | #endif | 249 | #endif |
| 250 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 250 | +#endif /* TARGET_MIPS64 */ |
| 251 | 251 | ||
| 252 | #if defined(CONFIG_USER_ONLY) | 252 | #if defined(CONFIG_USER_ONLY) |
| 253 | void do_mfc0_random (void) | 253 | void do_mfc0_random (void) |
| @@ -392,7 +392,7 @@ static void r4k_fill_tlb (int idx) | @@ -392,7 +392,7 @@ static void r4k_fill_tlb (int idx) | ||
| 392 | /* XXX: detect conflicting TLBs and raise a MCHECK exception when needed */ | 392 | /* XXX: detect conflicting TLBs and raise a MCHECK exception when needed */ |
| 393 | tlb = &env->tlb->mmu.r4k.tlb[idx]; | 393 | tlb = &env->tlb->mmu.r4k.tlb[idx]; |
| 394 | tlb->VPN = env->CP0_EntryHi & (TARGET_PAGE_MASK << 1); | 394 | tlb->VPN = env->CP0_EntryHi & (TARGET_PAGE_MASK << 1); |
| 395 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 395 | +#if defined(TARGET_MIPS64) |
| 396 | tlb->VPN &= env->SEGMask; | 396 | tlb->VPN &= env->SEGMask; |
| 397 | #endif | 397 | #endif |
| 398 | tlb->ASID = env->CP0_EntryHi & 0xFF; | 398 | tlb->ASID = env->CP0_EntryHi & 0xFF; |
target-mips/op_mem.c
| @@ -190,7 +190,7 @@ void glue(op_sc, MEMSUFFIX) (void) | @@ -190,7 +190,7 @@ void glue(op_sc, MEMSUFFIX) (void) | ||
| 190 | RETURN(); | 190 | RETURN(); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 193 | +#if defined(TARGET_MIPS64) |
| 194 | void glue(op_ld, MEMSUFFIX) (void) | 194 | void glue(op_ld, MEMSUFFIX) (void) |
| 195 | { | 195 | { |
| 196 | T0 = glue(ldq, MEMSUFFIX)(T0); | 196 | T0 = glue(ldq, MEMSUFFIX)(T0); |
| @@ -381,7 +381,7 @@ void glue(op_scd, MEMSUFFIX) (void) | @@ -381,7 +381,7 @@ void glue(op_scd, MEMSUFFIX) (void) | ||
| 381 | } | 381 | } |
| 382 | RETURN(); | 382 | RETURN(); |
| 383 | } | 383 | } |
| 384 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 384 | +#endif /* TARGET_MIPS64 */ |
| 385 | 385 | ||
| 386 | void glue(op_lwc1, MEMSUFFIX) (void) | 386 | void glue(op_lwc1, MEMSUFFIX) (void) |
| 387 | { | 387 | { |
target-mips/op_template.c
| @@ -82,7 +82,7 @@ SET_RESET(T2, _T2) | @@ -82,7 +82,7 @@ SET_RESET(T2, _T2) | ||
| 82 | 82 | ||
| 83 | #undef SET_RESET | 83 | #undef SET_RESET |
| 84 | 84 | ||
| 85 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 85 | +#if defined(TARGET_MIPS64) |
| 86 | #define SET64(treg, tregname) \ | 86 | #define SET64(treg, tregname) \ |
| 87 | void glue(op_set64, tregname)(void) \ | 87 | void glue(op_set64, tregname)(void) \ |
| 88 | { \ | 88 | { \ |
target-mips/translate.c
| @@ -590,7 +590,7 @@ do { \ | @@ -590,7 +590,7 @@ do { \ | ||
| 590 | } \ | 590 | } \ |
| 591 | } while (0) | 591 | } while (0) |
| 592 | 592 | ||
| 593 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 593 | +#if defined(TARGET_MIPS64) |
| 594 | #define GEN_LOAD_IMM_TN(Tn, Imm) \ | 594 | #define GEN_LOAD_IMM_TN(Tn, Imm) \ |
| 595 | do { \ | 595 | do { \ |
| 596 | if (Imm == 0) { \ | 596 | if (Imm == 0) { \ |
| @@ -638,7 +638,7 @@ do { \ | @@ -638,7 +638,7 @@ do { \ | ||
| 638 | 638 | ||
| 639 | static always_inline void gen_save_pc(target_ulong pc) | 639 | static always_inline void gen_save_pc(target_ulong pc) |
| 640 | { | 640 | { |
| 641 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 641 | +#if defined(TARGET_MIPS64) |
| 642 | if (pc == (int32_t)pc) { | 642 | if (pc == (int32_t)pc) { |
| 643 | gen_op_save_pc(pc); | 643 | gen_op_save_pc(pc); |
| 644 | } else { | 644 | } else { |
| @@ -651,7 +651,7 @@ static always_inline void gen_save_pc(target_ulong pc) | @@ -651,7 +651,7 @@ static always_inline void gen_save_pc(target_ulong pc) | ||
| 651 | 651 | ||
| 652 | static always_inline void gen_save_btarget(target_ulong btarget) | 652 | static always_inline void gen_save_btarget(target_ulong btarget) |
| 653 | { | 653 | { |
| 654 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 654 | +#if defined(TARGET_MIPS64) |
| 655 | if (btarget == (int32_t)btarget) { | 655 | if (btarget == (int32_t)btarget) { |
| 656 | gen_op_save_btarget(btarget); | 656 | gen_op_save_btarget(btarget); |
| 657 | } else { | 657 | } else { |
| @@ -802,7 +802,7 @@ static GenOpFunc *gen_op_s##width[] = { \ | @@ -802,7 +802,7 @@ static GenOpFunc *gen_op_s##width[] = { \ | ||
| 802 | } | 802 | } |
| 803 | #endif | 803 | #endif |
| 804 | 804 | ||
| 805 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 805 | +#if defined(TARGET_MIPS64) |
| 806 | OP_LD_TABLE(d); | 806 | OP_LD_TABLE(d); |
| 807 | OP_LD_TABLE(dl); | 807 | OP_LD_TABLE(dl); |
| 808 | OP_LD_TABLE(dr); | 808 | OP_LD_TABLE(dr); |
| @@ -852,7 +852,7 @@ static void gen_ldst (DisasContext *ctx, uint32_t opc, int rt, | @@ -852,7 +852,7 @@ static void gen_ldst (DisasContext *ctx, uint32_t opc, int rt, | ||
| 852 | /* Don't do NOP if destination is zero: we must perform the actual | 852 | /* Don't do NOP if destination is zero: we must perform the actual |
| 853 | memory access. */ | 853 | memory access. */ |
| 854 | switch (opc) { | 854 | switch (opc) { |
| 855 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 855 | +#if defined(TARGET_MIPS64) |
| 856 | case OPC_LWU: | 856 | case OPC_LWU: |
| 857 | op_ldst(lwu); | 857 | op_ldst(lwu); |
| 858 | GEN_STORE_TN_REG(rt, T0); | 858 | GEN_STORE_TN_REG(rt, T0); |
| @@ -1048,7 +1048,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1048,7 +1048,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1048 | switch (opc) { | 1048 | switch (opc) { |
| 1049 | case OPC_ADDI: | 1049 | case OPC_ADDI: |
| 1050 | case OPC_ADDIU: | 1050 | case OPC_ADDIU: |
| 1051 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1051 | +#if defined(TARGET_MIPS64) |
| 1052 | case OPC_DADDI: | 1052 | case OPC_DADDI: |
| 1053 | case OPC_DADDIU: | 1053 | case OPC_DADDIU: |
| 1054 | #endif | 1054 | #endif |
| @@ -1068,7 +1068,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1068,7 +1068,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1068 | case OPC_SLL: | 1068 | case OPC_SLL: |
| 1069 | case OPC_SRA: | 1069 | case OPC_SRA: |
| 1070 | case OPC_SRL: | 1070 | case OPC_SRL: |
| 1071 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1071 | +#if defined(TARGET_MIPS64) |
| 1072 | case OPC_DSLL: | 1072 | case OPC_DSLL: |
| 1073 | case OPC_DSRA: | 1073 | case OPC_DSRA: |
| 1074 | case OPC_DSRL: | 1074 | case OPC_DSRL: |
| @@ -1091,7 +1091,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1091,7 +1091,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1091 | gen_op_add(); | 1091 | gen_op_add(); |
| 1092 | opn = "addiu"; | 1092 | opn = "addiu"; |
| 1093 | break; | 1093 | break; |
| 1094 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1094 | +#if defined(TARGET_MIPS64) |
| 1095 | case OPC_DADDI: | 1095 | case OPC_DADDI: |
| 1096 | save_cpu_state(ctx, 1); | 1096 | save_cpu_state(ctx, 1); |
| 1097 | gen_op_daddo(); | 1097 | gen_op_daddo(); |
| @@ -1155,7 +1155,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1155,7 +1155,7 @@ static void gen_arith_imm (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1155 | break; | 1155 | break; |
| 1156 | } | 1156 | } |
| 1157 | break; | 1157 | break; |
| 1158 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1158 | +#if defined(TARGET_MIPS64) |
| 1159 | case OPC_DSLL: | 1159 | case OPC_DSLL: |
| 1160 | gen_op_dsll(); | 1160 | gen_op_dsll(); |
| 1161 | opn = "dsll"; | 1161 | opn = "dsll"; |
| @@ -1260,7 +1260,7 @@ static void gen_arith (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1260,7 +1260,7 @@ static void gen_arith (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1260 | gen_op_sub(); | 1260 | gen_op_sub(); |
| 1261 | opn = "subu"; | 1261 | opn = "subu"; |
| 1262 | break; | 1262 | break; |
| 1263 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1263 | +#if defined(TARGET_MIPS64) |
| 1264 | case OPC_DADD: | 1264 | case OPC_DADD: |
| 1265 | save_cpu_state(ctx, 1); | 1265 | save_cpu_state(ctx, 1); |
| 1266 | gen_op_daddo(); | 1266 | gen_op_daddo(); |
| @@ -1346,7 +1346,7 @@ static void gen_arith (CPUState *env, DisasContext *ctx, uint32_t opc, | @@ -1346,7 +1346,7 @@ static void gen_arith (CPUState *env, DisasContext *ctx, uint32_t opc, | ||
| 1346 | break; | 1346 | break; |
| 1347 | } | 1347 | } |
| 1348 | break; | 1348 | break; |
| 1349 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1349 | +#if defined(TARGET_MIPS64) |
| 1350 | case OPC_DSLLV: | 1350 | case OPC_DSLLV: |
| 1351 | gen_op_dsllv(); | 1351 | gen_op_dsllv(); |
| 1352 | opn = "dsllv"; | 1352 | opn = "dsllv"; |
| @@ -1451,7 +1451,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, | @@ -1451,7 +1451,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, | ||
| 1451 | gen_op_multu(); | 1451 | gen_op_multu(); |
| 1452 | opn = "multu"; | 1452 | opn = "multu"; |
| 1453 | break; | 1453 | break; |
| 1454 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1454 | +#if defined(TARGET_MIPS64) |
| 1455 | case OPC_DDIV: | 1455 | case OPC_DDIV: |
| 1456 | gen_op_ddiv(); | 1456 | gen_op_ddiv(); |
| 1457 | opn = "ddiv"; | 1457 | opn = "ddiv"; |
| @@ -1512,7 +1512,7 @@ static void gen_cl (DisasContext *ctx, uint32_t opc, | @@ -1512,7 +1512,7 @@ static void gen_cl (DisasContext *ctx, uint32_t opc, | ||
| 1512 | gen_op_clz(); | 1512 | gen_op_clz(); |
| 1513 | opn = "clz"; | 1513 | opn = "clz"; |
| 1514 | break; | 1514 | break; |
| 1515 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 1515 | +#if defined(TARGET_MIPS64) |
| 1516 | case OPC_DCLO: | 1516 | case OPC_DCLO: |
| 1517 | gen_op_dclo(); | 1517 | gen_op_dclo(); |
| 1518 | opn = "dclo"; | 1518 | opn = "dclo"; |
| @@ -2319,7 +2319,7 @@ static void gen_mfc0 (CPUState *env, DisasContext *ctx, int reg, int sel) | @@ -2319,7 +2319,7 @@ static void gen_mfc0 (CPUState *env, DisasContext *ctx, int reg, int sel) | ||
| 2319 | case 20: | 2319 | case 20: |
| 2320 | switch (sel) { | 2320 | switch (sel) { |
| 2321 | case 0: | 2321 | case 0: |
| 2322 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 2322 | +#if defined(TARGET_MIPS64) |
| 2323 | check_insn(env, ctx, ISA_MIPS3); | 2323 | check_insn(env, ctx, ISA_MIPS3); |
| 2324 | gen_op_mfc0_xcontext(); | 2324 | gen_op_mfc0_xcontext(); |
| 2325 | rn = "XContext"; | 2325 | rn = "XContext"; |
| @@ -2901,7 +2901,7 @@ static void gen_mtc0 (CPUState *env, DisasContext *ctx, int reg, int sel) | @@ -2901,7 +2901,7 @@ static void gen_mtc0 (CPUState *env, DisasContext *ctx, int reg, int sel) | ||
| 2901 | case 20: | 2901 | case 20: |
| 2902 | switch (sel) { | 2902 | switch (sel) { |
| 2903 | case 0: | 2903 | case 0: |
| 2904 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 2904 | +#if defined(TARGET_MIPS64) |
| 2905 | check_insn(env, ctx, ISA_MIPS3); | 2905 | check_insn(env, ctx, ISA_MIPS3); |
| 2906 | gen_op_mtc0_xcontext(); | 2906 | gen_op_mtc0_xcontext(); |
| 2907 | rn = "XContext"; | 2907 | rn = "XContext"; |
| @@ -3111,7 +3111,7 @@ die: | @@ -3111,7 +3111,7 @@ die: | ||
| 3111 | generate_exception(ctx, EXCP_RI); | 3111 | generate_exception(ctx, EXCP_RI); |
| 3112 | } | 3112 | } |
| 3113 | 3113 | ||
| 3114 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 3114 | +#if defined(TARGET_MIPS64) |
| 3115 | static void gen_dmfc0 (CPUState *env, DisasContext *ctx, int reg, int sel) | 3115 | static void gen_dmfc0 (CPUState *env, DisasContext *ctx, int reg, int sel) |
| 3116 | { | 3116 | { |
| 3117 | const char *rn = "invalid"; | 3117 | const char *rn = "invalid"; |
| @@ -4254,7 +4254,7 @@ die: | @@ -4254,7 +4254,7 @@ die: | ||
| 4254 | #endif | 4254 | #endif |
| 4255 | generate_exception(ctx, EXCP_RI); | 4255 | generate_exception(ctx, EXCP_RI); |
| 4256 | } | 4256 | } |
| 4257 | -#endif /* TARGET_MIPSN32 || TARGET_MIPS64 */ | 4257 | +#endif /* TARGET_MIPS64 */ |
| 4258 | 4258 | ||
| 4259 | static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, | 4259 | static void gen_mftr(CPUState *env, DisasContext *ctx, int rt, |
| 4260 | int u, int sel, int h) | 4260 | int u, int sel, int h) |
| @@ -4604,7 +4604,7 @@ static void gen_cp0 (CPUState *env, DisasContext *ctx, uint32_t opc, int rt, int | @@ -4604,7 +4604,7 @@ static void gen_cp0 (CPUState *env, DisasContext *ctx, uint32_t opc, int rt, int | ||
| 4604 | gen_mtc0(env, ctx, rd, ctx->opcode & 0x7); | 4604 | gen_mtc0(env, ctx, rd, ctx->opcode & 0x7); |
| 4605 | opn = "mtc0"; | 4605 | opn = "mtc0"; |
| 4606 | break; | 4606 | break; |
| 4607 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 4607 | +#if defined(TARGET_MIPS64) |
| 4608 | case OPC_DMFC0: | 4608 | case OPC_DMFC0: |
| 4609 | check_insn(env, ctx, ISA_MIPS3); | 4609 | check_insn(env, ctx, ISA_MIPS3); |
| 4610 | if (rt == 0) { | 4610 | if (rt == 0) { |
| @@ -5877,7 +5877,7 @@ static void gen_flt3_arith (DisasContext *ctx, uint32_t opc, | @@ -5877,7 +5877,7 @@ static void gen_flt3_arith (DisasContext *ctx, uint32_t opc, | ||
| 5877 | /* MIPS16 extension to MIPS32 */ | 5877 | /* MIPS16 extension to MIPS32 */ |
| 5878 | /* SmartMIPS extension to MIPS32 */ | 5878 | /* SmartMIPS extension to MIPS32 */ |
| 5879 | 5879 | ||
| 5880 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 5880 | +#if defined(TARGET_MIPS64) |
| 5881 | 5881 | ||
| 5882 | /* MDMX extension to MIPS64 */ | 5882 | /* MDMX extension to MIPS64 */ |
| 5883 | 5883 | ||
| @@ -5987,7 +5987,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -5987,7 +5987,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 5987 | } | 5987 | } |
| 5988 | break; | 5988 | break; |
| 5989 | 5989 | ||
| 5990 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 5990 | +#if defined(TARGET_MIPS64) |
| 5991 | /* MIPS64 specific opcodes */ | 5991 | /* MIPS64 specific opcodes */ |
| 5992 | case OPC_DSLL: | 5992 | case OPC_DSLL: |
| 5993 | case OPC_DSRL ... OPC_DSRA: | 5993 | case OPC_DSRL ... OPC_DSRA: |
| @@ -6043,7 +6043,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -6043,7 +6043,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 6043 | } | 6043 | } |
| 6044 | /* Treat as NOP. */ | 6044 | /* Treat as NOP. */ |
| 6045 | break; | 6045 | break; |
| 6046 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 6046 | +#if defined(TARGET_MIPS64) |
| 6047 | case OPC_DCLZ ... OPC_DCLO: | 6047 | case OPC_DCLZ ... OPC_DCLO: |
| 6048 | check_insn(env, ctx, ISA_MIPS64); | 6048 | check_insn(env, ctx, ISA_MIPS64); |
| 6049 | check_mips_64(ctx); | 6049 | check_mips_64(ctx); |
| @@ -6130,7 +6130,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -6130,7 +6130,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 6130 | gen_op_yield(); | 6130 | gen_op_yield(); |
| 6131 | GEN_STORE_TN_REG(rd, T0); | 6131 | GEN_STORE_TN_REG(rd, T0); |
| 6132 | break; | 6132 | break; |
| 6133 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 6133 | +#if defined(TARGET_MIPS64) |
| 6134 | case OPC_DEXTM ... OPC_DEXT: | 6134 | case OPC_DEXTM ... OPC_DEXT: |
| 6135 | case OPC_DINSM ... OPC_DINS: | 6135 | case OPC_DINSM ... OPC_DINS: |
| 6136 | check_insn(env, ctx, ISA_MIPS64R2); | 6136 | check_insn(env, ctx, ISA_MIPS64R2); |
| @@ -6192,7 +6192,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -6192,7 +6192,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 6192 | case OPC_MTC0: | 6192 | case OPC_MTC0: |
| 6193 | case OPC_MFTR: | 6193 | case OPC_MFTR: |
| 6194 | case OPC_MTTR: | 6194 | case OPC_MTTR: |
| 6195 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 6195 | +#if defined(TARGET_MIPS64) |
| 6196 | case OPC_DMFC0: | 6196 | case OPC_DMFC0: |
| 6197 | case OPC_DMTC0: | 6197 | case OPC_DMTC0: |
| 6198 | #endif | 6198 | #endif |
| @@ -6313,7 +6313,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -6313,7 +6313,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 6313 | case OPC_CTC1: | 6313 | case OPC_CTC1: |
| 6314 | gen_cp1(ctx, op1, rt, rd); | 6314 | gen_cp1(ctx, op1, rt, rd); |
| 6315 | break; | 6315 | break; |
| 6316 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 6316 | +#if defined(TARGET_MIPS64) |
| 6317 | case OPC_DMFC1: | 6317 | case OPC_DMFC1: |
| 6318 | case OPC_DMTC1: | 6318 | case OPC_DMTC1: |
| 6319 | check_insn(env, ctx, ISA_MIPS3); | 6319 | check_insn(env, ctx, ISA_MIPS3); |
| @@ -6398,7 +6398,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -6398,7 +6398,7 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 6398 | } | 6398 | } |
| 6399 | break; | 6399 | break; |
| 6400 | 6400 | ||
| 6401 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 6401 | +#if defined(TARGET_MIPS64) |
| 6402 | /* MIPS64 opcodes */ | 6402 | /* MIPS64 opcodes */ |
| 6403 | case OPC_LWU: | 6403 | case OPC_LWU: |
| 6404 | case OPC_LDL ... OPC_LDR: | 6404 | case OPC_LDL ... OPC_LDR: |
| @@ -6665,7 +6665,7 @@ void dump_fpu (CPUState *env) | @@ -6665,7 +6665,7 @@ void dump_fpu (CPUState *env) | ||
| 6665 | } | 6665 | } |
| 6666 | } | 6666 | } |
| 6667 | 6667 | ||
| 6668 | -#if (defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)) && defined(MIPS_DEBUG_SIGN_EXTENSIONS) | 6668 | +#if defined(TARGET_MIPS64) && defined(MIPS_DEBUG_SIGN_EXTENSIONS) |
| 6669 | /* Debug help: The architecture requires 32bit code to maintain proper | 6669 | /* Debug help: The architecture requires 32bit code to maintain proper |
| 6670 | sign-extened values on 64bit machines. */ | 6670 | sign-extened values on 64bit machines. */ |
| 6671 | 6671 | ||
| @@ -6720,7 +6720,7 @@ void cpu_dump_state (CPUState *env, FILE *f, | @@ -6720,7 +6720,7 @@ void cpu_dump_state (CPUState *env, FILE *f, | ||
| 6720 | env->CP0_Config0, env->CP0_Config1, env->CP0_LLAddr); | 6720 | env->CP0_Config0, env->CP0_Config1, env->CP0_LLAddr); |
| 6721 | if (env->hflags & MIPS_HFLAG_FPU) | 6721 | if (env->hflags & MIPS_HFLAG_FPU) |
| 6722 | fpu_dump_state(env, f, cpu_fprintf, flags); | 6722 | fpu_dump_state(env, f, cpu_fprintf, flags); |
| 6723 | -#if (defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)) && defined(MIPS_DEBUG_SIGN_EXTENSIONS) | 6723 | +#if defined(TARGET_MIPS64) && defined(MIPS_DEBUG_SIGN_EXTENSIONS) |
| 6724 | cpu_mips_check_sign_extensions(env, f, cpu_fprintf, flags); | 6724 | cpu_mips_check_sign_extensions(env, f, cpu_fprintf, flags); |
| 6725 | #endif | 6725 | #endif |
| 6726 | } | 6726 | } |
target-mips/translate_init.c
| @@ -201,7 +201,7 @@ static mips_def_t mips_defs[] = | @@ -201,7 +201,7 @@ static mips_def_t mips_defs[] = | ||
| 201 | (0x3fe << CP0SRSC4_SRS14) | (0x3fe << CP0SRSC4_SRS13), | 201 | (0x3fe << CP0SRSC4_SRS14) | (0x3fe << CP0SRSC4_SRS13), |
| 202 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_MT, | 202 | .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP | ASE_MT, |
| 203 | }, | 203 | }, |
| 204 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 204 | +#if defined(TARGET_MIPS64) |
| 205 | { | 205 | { |
| 206 | .name = "R4000", | 206 | .name = "R4000", |
| 207 | .CP0_PRid = 0x00000400, | 207 | .CP0_PRid = 0x00000400, |
| @@ -437,7 +437,7 @@ int cpu_mips_register (CPUMIPSState *env, mips_def_t *def) | @@ -437,7 +437,7 @@ int cpu_mips_register (CPUMIPSState *env, mips_def_t *def) | ||
| 437 | env->CP0_Status_rw_bitmask = def->CP0_Status_rw_bitmask; | 437 | env->CP0_Status_rw_bitmask = def->CP0_Status_rw_bitmask; |
| 438 | env->CP0_TCStatus_rw_bitmask = def->CP0_TCStatus_rw_bitmask; | 438 | env->CP0_TCStatus_rw_bitmask = def->CP0_TCStatus_rw_bitmask; |
| 439 | env->CP0_SRSCtl = def->CP0_SRSCtl; | 439 | env->CP0_SRSCtl = def->CP0_SRSCtl; |
| 440 | -#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64) | 440 | +#if defined(TARGET_MIPS64) |
| 441 | if (def->insn_flags & ISA_MIPS3) | 441 | if (def->insn_flags & ISA_MIPS3) |
| 442 | { | 442 | { |
| 443 | env->hflags |= MIPS_HFLAG_64; | 443 | env->hflags |= MIPS_HFLAG_64; |