diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-07 08:32:30 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-07 08:32:30 +0000 |
commit | 76a66253e5e48f1744f689041c1c21cedcaff630 (patch) | |
tree | c1003bd73ab8e2cbfe4a05c5b3f497bc2573fa4e /target-ppc/op_helper.h | |
parent | 1c7b3754f68382941a1921e578ead25d97d116fb (diff) |
Great PowerPC emulation code resynchronisation and improvments:
- Add status file to make regression tracking easier
- Move all micro-operations helpers definitions into a separate header:
should never be seen outside of op.c
- Update copyrights
- Add new / missing PowerPC CPU definitions
- Add definitions for PowerPC BookE
- Add support for PowerPC 6xx/7xx software driven TLBs
Allow use of PowerPC 603 as an example
- Add preliminary code for POWER, POWER2, PowerPC 403, 405, 440, 601, 602
and BookE support
- Avoid compiling priviledged only resources support for user-mode emulation
- Remove unused helpers / micro-ops / dead code
- Add instructions usage statistics dump: useful to figure which instructions
need strong optimizations.
- Micro-operation fixes:
* add missing RETURN in some micro-ops
* fix prototypes
* use softfloat routines for all floating-point operations
* fix tlbie instruction
* move some huge micro-operations into helpers
- emulation fixes:
* fix inverted opcodes for fcmpo / fcmpu
* condition register update is always to be done after the whole
instruction has completed
* add missing NIP updates when calling helpers that may generate an
exception
- optimizations and improvments:
* optimize very often used instructions (li, mr, rlwixx...)
* remove specific micro-ops for rarely used instructions
* add routines for addresses computations to avoid bugs due to multiple
different implementations
* fix TB linking: do not reset T0 at the end of every TB.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2473 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.h')
-rw-r--r-- | target-ppc/op_helper.h | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/target-ppc/op_helper.h b/target-ppc/op_helper.h new file mode 100644 index 0000000000..0cba00204a --- /dev/null +++ b/target-ppc/op_helper.h @@ -0,0 +1,132 @@ +/* + * PowerPC emulation helpers header for qemu. + * + * Copyright (c) 2003-2007 Jocelyn Mayer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#if defined(MEMSUFFIX) + +/* Memory load/store helpers */ +void glue(do_lsw, MEMSUFFIX) (int dst); +void glue(do_lsw_le, MEMSUFFIX) (int dst); +void glue(do_stsw, MEMSUFFIX) (int src); +void glue(do_stsw_le, MEMSUFFIX) (int src); +void glue(do_lmw, MEMSUFFIX) (int dst); +void glue(do_lmw_le, MEMSUFFIX) (int dst); +void glue(do_stmw, MEMSUFFIX) (int src); +void glue(do_stmw_le, MEMSUFFIX) (int src); +void glue(do_POWER_lscbx, MEMSUFFIX) (int dest, int ra, int rb); +void glue(do_POWER2_lfq, MEMSUFFIX) (void); +void glue(do_POWER2_lfq_le, MEMSUFFIX) (void); +void glue(do_POWER2_stfq, MEMSUFFIX) (void); +void glue(do_POWER2_stfq_le, MEMSUFFIX) (void); + +#else + +/* Registers load and stores */ +void do_load_cr (void); +void do_store_cr (uint32_t mask); +void do_load_xer (void); +void do_store_xer (void); +void do_load_fpscr (void); +void do_store_fpscr (uint32_t mask); + +/* Integer arithmetic helpers */ +void do_addo (void); +void do_addco (void); +void do_adde (void); +void do_addeo (void); +void do_addmeo (void); +void do_addzeo (void); +void do_divwo (void); +void do_divwuo (void); +void do_mullwo (void); +void do_nego (void); +void do_subfo (void); +void do_subfco (void); +void do_subfe (void); +void do_subfeo (void); +void do_subfmeo (void); +void do_subfzeo (void); +void do_sraw(void); + +/* Floating-point arithmetic helpers */ +void do_fsqrt (void); +void do_fres (void); +void do_frsqrte (void); +void do_fsel (void); +void do_fnmadd (void); +void do_fnmsub (void); +void do_fctiw (void); +void do_fctiwz (void); +void do_fcmpu (void); +void do_fcmpo (void); + +void do_tw (int flags); +void do_icbi (void); + +#if !defined(CONFIG_USER_ONLY) +void do_rfi (void); +void do_tlbia (void); +void do_tlbie (void); +void do_load_6xx_tlb (int is_code); +#endif + +/* POWER / PowerPC 601 specific helpers */ +void do_store_601_batu (int nr); +void do_POWER_abso (void); +void do_POWER_clcs (void); +void do_POWER_div (void); +void do_POWER_divo (void); +void do_POWER_divs (void); +void do_POWER_divso (void); +void do_POWER_dozo (void); +void do_POWER_maskg (void); +void do_POWER_mulo (void); +#if !defined(CONFIG_USER_ONLY) +void do_POWER_rac (void); +void do_POWER_rfsvc (void); +#endif + +/* PowerPC 602 specific helper */ +#if !defined(CONFIG_USER_ONLY) +void do_op_602_mfrom (void); +#endif + +/* PowerPC 4xx specific helpers */ +void do_405_check_ov (void); +void do_405_check_sat (void); +#if !defined(CONFIG_USER_ONLY) +void do_4xx_load_dcr (int dcrn); +void do_4xx_store_dcr (int dcrn); +void do_4xx_rfci (void); +void do_4xx_tlbre_lo (void); +void do_4xx_tlbre_hi (void); +void do_4xx_tlbsx (void); +void do_4xx_tlbsx_ (void); +void do_4xx_tlbwe_lo (void); +void do_4xx_tlbwe_hi (void); +#endif + +void do_440_dlmzb (void); + +#if !defined(CONFIG_USER_ONLY) +void do_load_403_pb (int num); +void do_store_403_pb (int num); +#endif + +#endif |