Commit 35cdaad645d7a97e67690582feb1fc3a050c92ad
1 parent
c294fc58
Code provision for new PowerPC embedded target support with:
- 1 kB page size - 64 bits GPR - 64 bits physical address space - SPE extension support. Change TARGET_PPCSPE into TARGET_PPCEMB git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2718 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
8 changed files
with
26 additions
and
21 deletions
target-ppc/cpu.h
... | ... | @@ -23,11 +23,13 @@ |
23 | 23 | #include "config.h" |
24 | 24 | #include <inttypes.h> |
25 | 25 | |
26 | +#if !defined(TARGET_PPCEMB) | |
26 | 27 | #if defined(TARGET_PPC64) || (HOST_LONG_BITS >= 64) |
27 | 28 | /* When using 64 bits temporary registers, |
28 | 29 | * we can use 64 bits GPR with no extra cost |
29 | 30 | */ |
30 | -#define TARGET_PPCSPE | |
31 | +#define TARGET_PPCEMB | |
32 | +#endif | |
31 | 33 | #endif |
32 | 34 | |
33 | 35 | #if defined (TARGET_PPC64) |
... | ... | @@ -35,7 +37,8 @@ typedef uint64_t ppc_gpr_t; |
35 | 37 | #define TARGET_LONG_BITS 64 |
36 | 38 | #define TARGET_GPR_BITS 64 |
37 | 39 | #define REGX "%016" PRIx64 |
38 | -#elif defined(TARGET_PPCSPE) | |
40 | +#define TARGET_PAGE_BITS 12 | |
41 | +#elif defined(TARGET_PPCEMB) | |
39 | 42 | /* e500v2 have 36 bits physical address space */ |
40 | 43 | #define TARGET_PHYS_ADDR_BITS 64 |
41 | 44 | /* GPR are 64 bits: used by vector extension */ |
... | ... | @@ -43,11 +46,14 @@ typedef uint64_t ppc_gpr_t; |
43 | 46 | #define TARGET_LONG_BITS 32 |
44 | 47 | #define TARGET_GPR_BITS 64 |
45 | 48 | #define REGX "%016" PRIx64 |
49 | +/* Pages can be 1 kB small */ | |
50 | +#define TARGET_PAGE_BITS 10 | |
46 | 51 | #else |
47 | 52 | typedef uint32_t ppc_gpr_t; |
48 | 53 | #define TARGET_LONG_BITS 32 |
49 | 54 | #define TARGET_GPR_BITS 32 |
50 | 55 | #define REGX "%08" PRIx32 |
56 | +#define TARGET_PAGE_BITS 12 | |
51 | 57 | #endif |
52 | 58 | |
53 | 59 | #include "cpu-defs.h" |
... | ... | @@ -893,7 +899,6 @@ int ppcemb_tlb_search (CPUPPCState *env, target_ulong address); |
893 | 899 | int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, target_ulong *valp); |
894 | 900 | int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val); |
895 | 901 | |
896 | -#define TARGET_PAGE_BITS 12 | |
897 | 902 | #include "cpu-all.h" |
898 | 903 | |
899 | 904 | /*****************************************************************************/ | ... | ... |
target-ppc/exec.h
... | ... | @@ -43,7 +43,7 @@ register unsigned long T1 asm(AREG2); |
43 | 43 | register unsigned long T2 asm(AREG3); |
44 | 44 | #endif |
45 | 45 | /* We may, sometime, need 64 bits registers on 32 bits target */ |
46 | -#if defined(TARGET_PPC64) || defined(TARGET_PPCSPE) || (HOST_LONG_BITS == 64) | |
46 | +#if defined(TARGET_PPC64) || defined(TARGET_PPCEMB) || (HOST_LONG_BITS == 64) | |
47 | 47 | #define T0_64 T0 |
48 | 48 | #define T1_64 T1 |
49 | 49 | #define T2_64 T2 | ... | ... |
target-ppc/op.c
... | ... | @@ -2479,7 +2479,7 @@ void OPPROTO op_store_booke_tsr (void) |
2479 | 2479 | |
2480 | 2480 | #endif /* !defined(CONFIG_USER_ONLY) */ |
2481 | 2481 | |
2482 | -#if defined(TARGET_PPCSPE) | |
2482 | +#if defined(TARGET_PPCEMB) | |
2483 | 2483 | /* SPE extension */ |
2484 | 2484 | void OPPROTO op_splatw_T1_64 (void) |
2485 | 2485 | { |
... | ... | @@ -3198,4 +3198,4 @@ void OPPROTO op_efdtsteq (void) |
3198 | 3198 | T0 = _do_efdtsteq(T0_64, T1_64); |
3199 | 3199 | RETURN(); |
3200 | 3200 | } |
3201 | -#endif /* defined(TARGET_PPCSPE) */ | |
3201 | +#endif /* defined(TARGET_PPCEMB) */ | ... | ... |
target-ppc/op_helper.c
... | ... | @@ -1340,7 +1340,7 @@ void do_440_dlmzb (void) |
1340 | 1340 | T0 = i; |
1341 | 1341 | } |
1342 | 1342 | |
1343 | -#if defined(TARGET_PPCSPE) | |
1343 | +#if defined(TARGET_PPCEMB) | |
1344 | 1344 | /* SPE extension helpers */ |
1345 | 1345 | /* Use a table to make this quicker */ |
1346 | 1346 | static uint8_t hbrev[16] = { |
... | ... | @@ -2200,7 +2200,7 @@ DO_SPE_OP1(fsctuiz); |
2200 | 2200 | DO_SPE_OP1(fsctsf); |
2201 | 2201 | /* evfsctuf */ |
2202 | 2202 | DO_SPE_OP1(fsctuf); |
2203 | -#endif /* defined(TARGET_PPCSPE) */ | |
2203 | +#endif /* defined(TARGET_PPCEMB) */ | |
2204 | 2204 | |
2205 | 2205 | /*****************************************************************************/ |
2206 | 2206 | /* Softmmu support */ | ... | ... |
target-ppc/op_helper.h
... | ... | @@ -183,7 +183,7 @@ void do_load_403_pb (int num); |
183 | 183 | void do_store_403_pb (int num); |
184 | 184 | #endif |
185 | 185 | |
186 | -#if defined(TARGET_PPCSPE) | |
186 | +#if defined(TARGET_PPCEMB) | |
187 | 187 | /* SPE extension helpers */ |
188 | 188 | void do_brinc (void); |
189 | 189 | /* Fixed-point vector helpers */ |
... | ... | @@ -264,7 +264,7 @@ void do_evfsctsi (void); |
264 | 264 | void do_evfsctui (void); |
265 | 265 | void do_evfsctsiz (void); |
266 | 266 | void do_evfsctuiz (void); |
267 | -#endif /* defined(TARGET_PPCSPE) */ | |
267 | +#endif /* defined(TARGET_PPCEMB) */ | |
268 | 268 | |
269 | 269 | /* Inlined helpers: used in micro-operation as well as helpers */ |
270 | 270 | /* Generic fixed-point helpers */ |
... | ... | @@ -338,7 +338,7 @@ static inline int _do_cntlzd (uint64_t val) |
338 | 338 | return cnt; |
339 | 339 | } |
340 | 340 | |
341 | -#if defined(TARGET_PPCSPE) | |
341 | +#if defined(TARGET_PPCEMB) | |
342 | 342 | /* SPE extension */ |
343 | 343 | /* Single precision floating-point helpers */ |
344 | 344 | static inline uint32_t _do_efsabs (uint32_t val) |
... | ... | @@ -459,5 +459,5 @@ static inline int _do_efdtsteq (uint64_t op1, uint64_t op2) |
459 | 459 | u2.u = op2; |
460 | 460 | return float64_eq(u1.f, u2.f, &env->spe_status) ? 1 : 0; |
461 | 461 | } |
462 | -#endif /* defined(TARGET_PPCSPE) */ | |
462 | +#endif /* defined(TARGET_PPCEMB) */ | |
463 | 463 | #endif | ... | ... |
target-ppc/op_mem.h
... | ... | @@ -37,7 +37,7 @@ static inline uint32_t glue(ld32r, MEMSUFFIX) (target_ulong EA) |
37 | 37 | ((tmp & 0x0000FF00) << 8) | ((tmp & 0x000000FF) << 24); |
38 | 38 | } |
39 | 39 | |
40 | -#if defined(TARGET_PPC64) || defined(TARGET_PPCSPE) | |
40 | +#if defined(TARGET_PPC64) || defined(TARGET_PPCEMB) | |
41 | 41 | static inline uint64_t glue(ld64r, MEMSUFFIX) (target_ulong EA) |
42 | 42 | { |
43 | 43 | uint64_t tmp = glue(ldq, MEMSUFFIX)(EA); |
... | ... | @@ -79,7 +79,7 @@ static inline void glue(st32r, MEMSUFFIX) (target_ulong EA, uint32_t data) |
79 | 79 | glue(stl, MEMSUFFIX)(EA, tmp); |
80 | 80 | } |
81 | 81 | |
82 | -#if defined(TARGET_PPC64) || defined(TARGET_PPCSPE) | |
82 | +#if defined(TARGET_PPC64) || defined(TARGET_PPCEMB) | |
83 | 83 | static inline void glue(st64r, MEMSUFFIX) (target_ulong EA, uint64_t data) |
84 | 84 | { |
85 | 85 | uint64_t tmp = ((data & 0xFF00000000000000ULL) >> 56) | |
... | ... | @@ -895,7 +895,7 @@ void OPPROTO glue(op_POWER2_stfq_le, MEMSUFFIX) (void) |
895 | 895 | RETURN(); |
896 | 896 | } |
897 | 897 | |
898 | -#if defined(TARGET_PPCSPE) | |
898 | +#if defined(TARGET_PPCEMB) | |
899 | 899 | /* SPE extension */ |
900 | 900 | #define _PPC_SPE_LD_OP(name, op) \ |
901 | 901 | void OPPROTO glue(glue(op_spe_l, name), MEMSUFFIX) (void) \ |
... | ... | @@ -1151,6 +1151,6 @@ static inline uint64_t glue(spe_lwhsplat_le, MEMSUFFIX) (target_ulong EA) |
1151 | 1151 | return ret; |
1152 | 1152 | } |
1153 | 1153 | PPC_SPE_LD_OP(whsplat_le, spe_lwhsplat_le); |
1154 | -#endif /* defined(TARGET_PPCSPE) */ | |
1154 | +#endif /* defined(TARGET_PPCEMB) */ | |
1155 | 1155 | |
1156 | 1156 | #undef MEMSUFFIX | ... | ... |
target-ppc/op_template.h
... | ... | @@ -57,7 +57,7 @@ void OPPROTO glue(op_store_T2_gpr_gpr, REG) (void) |
57 | 57 | } |
58 | 58 | #endif |
59 | 59 | |
60 | -#if defined(TARGET_PPCSPE) | |
60 | +#if defined(TARGET_PPCEMB) | |
61 | 61 | void OPPROTO glue(op_load_gpr64_T0_gpr, REG) (void) |
62 | 62 | { |
63 | 63 | T0_64 = regs->gpr[REG]; |
... | ... | @@ -97,7 +97,7 @@ void OPPROTO glue(op_store_T2_gpr64_gpr, REG) (void) |
97 | 97 | RETURN(); |
98 | 98 | } |
99 | 99 | #endif |
100 | -#endif /* defined(TARGET_PPCSPE) */ | |
100 | +#endif /* defined(TARGET_PPCEMB) */ | |
101 | 101 | |
102 | 102 | #if REG <= 7 |
103 | 103 | /* Condition register moves */ | ... | ... |
target-ppc/translate.c
... | ... | @@ -161,7 +161,7 @@ typedef struct DisasContext { |
161 | 161 | int sf_mode; |
162 | 162 | #endif |
163 | 163 | int fpu_enabled; |
164 | -#if defined(TARGET_PPCSPE) | |
164 | +#if defined(TARGET_PPCEMB) | |
165 | 165 | int spe_enabled; |
166 | 166 | #endif |
167 | 167 | ppc_spr_t *spr_cb; /* Needed to check rights for mfspr/mtspr */ |
... | ... | @@ -4761,7 +4761,7 @@ GEN_HANDLER(icbt_440, 0x1F, 0x16, 0x00, 0x03E00001, PPC_BOOKE) |
4761 | 4761 | */ |
4762 | 4762 | } |
4763 | 4763 | |
4764 | -#if defined(TARGET_PPCSPE) | |
4764 | +#if defined(TARGET_PPCEMB) | |
4765 | 4765 | /*** SPE extension ***/ |
4766 | 4766 | |
4767 | 4767 | /* Register moves */ |
... | ... | @@ -5740,7 +5740,7 @@ static inline int gen_intermediate_code_internal (CPUState *env, |
5740 | 5740 | ctx.sf_mode = msr_sf; |
5741 | 5741 | #endif |
5742 | 5742 | ctx.fpu_enabled = msr_fp; |
5743 | -#if defined(TARGET_PPCSPE) | |
5743 | +#if defined(TARGET_PPCEMB) | |
5744 | 5744 | ctx.spe_enabled = msr_spe; |
5745 | 5745 | #endif |
5746 | 5746 | ctx.singlestep_enabled = env->singlestep_enabled; | ... | ... |