mirror of
https://github.com/n64dev/cen64.git
synced 2024-06-23 14:33:13 -04:00
Unroll the top-level hot functions.
This commit is contained in:
parent
720970f176
commit
3cc07a7ae4
|
@ -49,10 +49,10 @@ struct bus_controller {
|
|||
cen64_cold int bus_init(struct bus_controller *bus);
|
||||
|
||||
// General-purpose accesssor functions.
|
||||
cen64_hot int bus_read_word(struct bus_controller *bus,
|
||||
cen64_flatten cen64_hot int bus_read_word(struct bus_controller *bus,
|
||||
uint32_t address, uint32_t *word);
|
||||
|
||||
cen64_hot int bus_write_word(struct bus_controller *bus,
|
||||
cen64_flatten cen64_hot int bus_write_word(struct bus_controller *bus,
|
||||
uint32_t address, uint32_t word, uint32_t dqm);
|
||||
|
||||
// For asserting and deasserting RCP interrupts.
|
||||
|
|
|
@ -100,6 +100,13 @@ typedef char bool;
|
|||
#define cen64_hot
|
||||
#endif
|
||||
|
||||
// Define cen64_flatten.
|
||||
#ifdef __GNUC__
|
||||
#define cen64_flatten __attribute__((flatten))
|
||||
#else
|
||||
#define cen64_flatten
|
||||
#endif
|
||||
|
||||
// Define likely()/unlikely().
|
||||
#ifdef __GNUC__
|
||||
#define likely(expr) __builtin_expect(!!(expr), !0)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "vr4300/cp1.h"
|
||||
|
||||
cen64_cold static int device_debug_spin(struct cen64_device *device);
|
||||
cen64_hot static int device_spin(struct cen64_device *device);
|
||||
cen64_flatten cen64_hot static int device_spin(struct cen64_device *device);
|
||||
|
||||
// Creates and initializes a device.
|
||||
struct cen64_device *device_create(struct cen64_device *device, uint8_t *ram,
|
||||
|
|
|
@ -71,7 +71,7 @@ cen64_cold int rsp_init(struct rsp *rsp, struct bus_controller *bus);
|
|||
cen64_cold void rsp_late_init(struct rsp *rsp);
|
||||
cen64_cold void rsp_destroy(struct rsp *rsp);
|
||||
|
||||
cen64_hot void rsp_cycle(struct rsp *rsp);
|
||||
cen64_flatten cen64_hot void rsp_cycle(struct rsp *rsp);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ static inline int rsp_rd_stage(struct rsp *rsp) {
|
|||
}
|
||||
|
||||
// Execution stage.
|
||||
static inline void rsp_ex_stage(struct rsp *rsp) {
|
||||
cen64_flatten static inline void rsp_ex_stage(struct rsp *rsp) {
|
||||
struct rsp_dfwb_latch *dfwb_latch = &rsp->pipeline.dfwb_latch;
|
||||
struct rsp_exdf_latch *exdf_latch = &rsp->pipeline.exdf_latch;
|
||||
struct rsp_rdex_latch *rdex_latch = &rsp->pipeline.rdex_latch;
|
||||
|
@ -114,7 +114,7 @@ static inline void rsp_ex_stage(struct rsp *rsp) {
|
|||
}
|
||||
|
||||
// Execution stage (vector).
|
||||
static inline void rsp_v_ex_stage(struct rsp *rsp) {
|
||||
cen64_flatten static inline void rsp_v_ex_stage(struct rsp *rsp) {
|
||||
struct rsp_rdex_latch *rdex_latch = &rsp->pipeline.rdex_latch;
|
||||
|
||||
rsp_vect_t vd_reg, vs_reg, vt_shuf_reg, zero;
|
||||
|
@ -148,7 +148,7 @@ static inline void rsp_v_ex_stage(struct rsp *rsp) {
|
|||
}
|
||||
|
||||
// Data cache fetch stage.
|
||||
static inline void rsp_df_stage(struct rsp *rsp) {
|
||||
cen64_flatten static inline void rsp_df_stage(struct rsp *rsp) {
|
||||
struct rsp_dfwb_latch *dfwb_latch = &rsp->pipeline.dfwb_latch;
|
||||
struct rsp_exdf_latch *exdf_latch = &rsp->pipeline.exdf_latch;
|
||||
const struct rsp_mem_request *request = &exdf_latch->request;
|
||||
|
|
|
@ -58,7 +58,7 @@ void gl_window_render_frame(struct gl_window *gl_window, const uint8_t *buffer,
|
|||
|
||||
cen64_cold int vi_init(struct vi_controller *vi, struct bus_controller *bus);
|
||||
|
||||
cen64_hot void vi_cycle(struct vi_controller *vi);
|
||||
cen64_flatten cen64_hot void vi_cycle(struct vi_controller *vi);
|
||||
|
||||
cen64_cold int read_vi_regs(void *opaque, uint32_t address, uint32_t *word);
|
||||
cen64_cold int write_vi_regs(void *opaque, uint32_t address, uint32_t word, uint32_t dqm);
|
||||
|
|
|
@ -119,7 +119,7 @@ struct vr4300_stats {
|
|||
cen64_cold int vr4300_init(struct vr4300 *vr4300, struct bus_controller *bus);
|
||||
cen64_cold void vr4300_print_summary(struct vr4300_stats *stats);
|
||||
|
||||
cen64_hot void vr4300_cycle(struct vr4300 *vr4300);
|
||||
cen64_flatten cen64_hot void vr4300_cycle(struct vr4300 *vr4300);
|
||||
cen64_hot void vr4300_cycle_extra(struct vr4300 *vr4300, struct vr4300_stats *stats);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,7 +32,7 @@ static void vr4300_cycle_busywait(struct vr4300 *vr4300);
|
|||
//#define PRINT_EXEC
|
||||
|
||||
// Instruction cache stage.
|
||||
static void vr4300_ic_stage(struct vr4300 *vr4300) {
|
||||
cen64_flatten static void vr4300_ic_stage(struct vr4300 *vr4300) {
|
||||
struct vr4300_rfex_latch *rfex_latch = &vr4300->pipeline.rfex_latch;
|
||||
struct vr4300_icrf_latch *icrf_latch = &vr4300->pipeline.icrf_latch;
|
||||
|
||||
|
|
Loading…
Reference in a new issue