Unroll the top-level hot functions.

This commit is contained in:
Tyler Stachecki 2015-01-22 14:20:21 -05:00
parent 720970f176
commit 3cc07a7ae4
8 changed files with 17 additions and 10 deletions

View file

@ -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.

View file

@ -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)

View file

@ -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,

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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;