1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_ppc_instr_loadstore.c,v 1.6 2005/11/23 06:59:52 debug Exp $ |
* $Id: cpu_ppc_instr_loadstore.c,v 1.9 2006/04/02 10:21:08 debug Exp $ |
29 |
* |
* |
30 |
* POWER/PowerPC load/store instructions. |
* POWER/PowerPC load/store instructions. |
31 |
* |
* |
44 |
void LS_GENERIC_N(struct cpu *cpu, struct ppc_instr_call *ic) |
void LS_GENERIC_N(struct cpu *cpu, struct ppc_instr_call *ic) |
45 |
{ |
{ |
46 |
#ifdef MODE32 |
#ifdef MODE32 |
47 |
uint32_t addr = reg(ic->arg[1]) + |
uint32_t addr = |
48 |
|
#else |
49 |
|
uint64_t addr = |
50 |
|
#endif |
51 |
|
reg(ic->arg[1]) + |
52 |
#ifdef LS_INDEXED |
#ifdef LS_INDEXED |
53 |
reg(ic->arg[2]); |
reg(ic->arg[2]); |
54 |
#else |
#else |
165 |
#ifdef LS_UPDATE |
#ifdef LS_UPDATE |
166 |
reg(ic->arg[1]) = addr; |
reg(ic->arg[1]) = addr; |
167 |
#endif |
#endif |
|
#else /* !MODE32 */ |
|
|
fatal("TODO: mode64\n"); |
|
|
#endif /* !MODE32 */ |
|
168 |
} |
} |
169 |
#endif |
#endif |
170 |
|
|
172 |
void LS_N(struct cpu *cpu, struct ppc_instr_call *ic) |
void LS_N(struct cpu *cpu, struct ppc_instr_call *ic) |
173 |
{ |
{ |
174 |
#ifdef MODE32 |
#ifdef MODE32 |
175 |
uint32_t addr = reg(ic->arg[1]) |
uint32_t addr = |
176 |
|
#else |
177 |
|
uint64_t addr = |
178 |
|
#endif |
179 |
|
reg(ic->arg[1]) |
180 |
#ifdef LS_INDEXED |
#ifdef LS_INDEXED |
181 |
+ reg(ic->arg[2]) |
+ reg(ic->arg[2]) |
182 |
#else |
#else |
204 |
} |
} |
205 |
#endif |
#endif |
206 |
|
|
207 |
|
|
208 |
|
#ifndef MODE32 |
209 |
|
/*******************************************/ |
210 |
|
if (!cpu->is_32bit) { |
211 |
|
LS_GENERIC_N(cpu, ic); |
212 |
|
return; |
213 |
|
} |
214 |
|
/*******************************************/ |
215 |
|
#endif |
216 |
|
|
217 |
|
|
218 |
if (page == NULL) { |
if (page == NULL) { |
219 |
LS_GENERIC_N(cpu, ic); |
LS_GENERIC_N(cpu, ic); |
220 |
return; |
return; |
310 |
#ifdef LS_UPDATE |
#ifdef LS_UPDATE |
311 |
reg(ic->arg[1]) = new_addr; |
reg(ic->arg[1]) = new_addr; |
312 |
#endif |
#endif |
|
|
|
|
#else /* !MODE32 */ |
|
|
fatal("ppc load/store mode64: TODO\n"); |
|
|
exit(1); |
|
|
#endif |
|
313 |
} |
} |
314 |
|
|