+ static const char *const ppc_branch_conditional_name[32] = {
+ "branch if --CTR != 0 and condition is FALSE", /* 0000y */
+ "branch if --CTR != 0 and condition is FALSE, reverse branch likely",
+ "branch if --CTR == 0 and condition is FALSE", /* 0001y */
+ "branch if --CTR == 0 and condition is FALSE, reverse branch likely",
+ "branch if the condition is FALSE", /* 001zy */
+ "branch if the condition is FALSE, reverse branch likely",
+ "branch if the condition is FALSE (ignored bit 1 set to 1)", /* 001zy */
+ "branch if the condition is FALSE, reverse branch likely (ignored bit 4 set to 1)",
+ "branch if --CTR != 0 and condition is TRUE", /* 0100y */
+ "branch if --CTR != 0 and condition is TRUE, reverse branch likely",
+ "branch if --CTR == 0 and condition is TRUE", /* 0101y */
+ "branch if --CTR == 0 and condition is TRUE, reverse branch likely",
+ "branch if the condition is TRUE", /* 011zy */
+ "branch if the condition is TRUE, reverse branch likely",
+ "branch if the condition is TRUE (ignored bit 1 set to 1)", /* 011zy */
+ "branch if the condition is TRUE, reverse branch likely (ignored bit 4 set to 1)",
+ "branch if --CTR != 0", /* 1z00y */
+ "branch if --CTR != 0, reverse branch likely",
+ "branch if --CTR == 0", /* 1z01y */
+ "branch if --CTR == 0, reverse branch likely",
+ "branch always", /* 1z1zz */
+ "branch always (ignored bit 5 set to 1)",
+ "branch always (ignored bit 4 set to 1)", /* 1z1zz */
+ "branch always (ignored bits 4,5 set to 1)",
+ "branch if --CTR != 0 (ignored bit 1 set to 1)", /* 1z00y */
+ "branch if --CTR != 0, reverse branch likely (ignored bit 1 set to 1)",
+ "branch if --CTR == 0 (ignored bit 1 set to 1)", /* 1z01y */
+ "branch if --CTR == 0, reverse branch likely (ignored bit 1 set to 1)",
+ "branch always (ignored bit 1 set to 1)", /* 1z1zz */
+ "branch always (ignored bits 1,5 set to 1)",
+ "branch always (ignored bits 1,4 set to 1)", /* 1z1zz */
+ "branch always (ignored bits 1,4,5 set to 1)",
+ };
+
+ static const char *const ppc_nr_mtcrf_crs[9] = {
+ "mtcrf moving 0 CRs",
+ "mtcrf moving 1 CR",
+ "mtcrf moving 2 CRs",
+ "mtcrf moving 3 CRs",
+ "mtcrf moving 4 CRs",
+ "mtcrf moving 5 CRs",
+ "mtcrf moving 6 CRs",
+ "mtcrf moving 7 CRs",
+ "mtcrf moving all CRs",
+ };
+\f
+# Trace releasing resources
+void::model-static::model_trace_release:model_data *model_ptr, model_busy *busy
+ int i;
+ TRACE(trace_model,("done, %s, %d writeback%s\n", ppc_function_unit_name[busy->unit],
+ busy->nr_writebacks, busy->nr_writebacks == 1 ? "" : "s"));
+ if (busy->int_busy) {
+ for(i = 0; i < 32; i++) {
+ if (((1 << i) & busy->int_busy) != 0) {
+ TRACE(trace_model, ("Register r%d is now available.\n", i));
+ }
+ }
+ }
+ if (busy->fp_busy) {
+ for(i = 0; i < 32; i++) {
+ if (((1 << i) & busy->fp_busy) != 0) {
+ TRACE(trace_model, ("Register f%d is now available.\n", i));
+ }
+ }
+ }
+ if (busy->cr_fpscr_busy) {
+ for(i = 0; i < 8; i++) {
+ if (((1 << i) & busy->cr_fpscr_busy) != 0) {
+ TRACE(trace_model, ("Register cr%d is now available.\n", i));
+ }
+ }
+ if (busy->cr_fpscr_busy & 0x100)
+ TRACE(trace_model, ("Register fpscr is now available.\n"));
+ }
+ if (busy->spr_busy != PPC_NO_SPR)
+ TRACE(trace_model, ("Register %s is now available.\n", spr_name(busy->spr_busy)));
+ if (busy->vr_busy) {
+ for(i = 0; i < 32; i++) {
+ if (((1 << i) & busy->vr_busy) != 0) {
+ TRACE(trace_model, ("Register v%d is now available.\n", i));
+ }
+ }
+ }
+ if (busy->vscr_busy)
+ TRACE(trace_model, ("VSCR Register is now available.\n", spr_name(busy->spr_busy)));
+
+# Trace making registers busy
+void::model-static::model_trace_make_busy:model_data *model_ptr, unsigned32 int_mask, unsigned32 fp_mask, unsigned32 cr_mask
+ int i;
+ if (int_mask) {
+ for(i = 0; i < 32; i++) {
+ if (((1 << i) & int_mask) != 0) {
+ TRACE(trace_model, ("Register r%d is now busy.\n", i));
+ }
+ }
+ }
+ if (fp_mask) {
+ for(i = 0; i < 32; i++) {
+ if (((1 << i) & fp_mask) != 0) {
+ TRACE(trace_model, ("Register f%d is now busy.\n", i));
+ }
+ }
+ }
+ if (cr_mask) {
+ for(i = 0; i < 8; i++) {
+ if (((1 << i) & cr_mask) != 0) {
+ TRACE(trace_model, ("Register cr%d is now busy.\n", i));
+ }
+ }