diff options
-rw-r--r-- | cgcalc.c | 12 | ||||
-rw-r--r-- | cgcodep.h | 3 | ||||
-rw-r--r-- | cgconst.h | 2 | ||||
-rw-r--r-- | cginput.c | 3 | ||||
-rw-r--r-- | cginstructions.c | 26 | ||||
-rw-r--r-- | cglin.c | 28 |
6 files changed, 73 insertions, 1 deletions
@@ -2184,6 +2184,9 @@ void calculate_graph_register_uses (INSTRUCTION_GRAPH graph) return; } case GLOAD_DES_ID: +#ifdef G_AI64 + case GLOAD_SQB_ID: +#endif { INSTRUCTION_GRAPH graph_1; @@ -2857,6 +2860,9 @@ void count_graph (INSTRUCTION_GRAPH graph) case GLOAD_ID: case GLOAD_B_ID: case GLOAD_DES_ID: +#ifdef G_AI64 + case GLOAD_SQB_ID: +#endif if (++graph->node_count==1) count_graph (graph->instruction_parameters[1].p); break; @@ -3085,6 +3091,9 @@ void mark_graph_2 (register INSTRUCTION_GRAPH graph) case GLOAD_ID: case GLOAD_B_ID: case GLOAD_DES_ID: +#ifdef G_AI64 + case GLOAD_SQB_ID: +#endif if (graph->node_mark<2){ graph->node_mark=2; mark_graph_2 (graph->instruction_parameters[1].p); @@ -3315,6 +3324,9 @@ void mark_graph_1 (register INSTRUCTION_GRAPH graph) case GLOAD_ID: case GLOAD_B_ID: case GLOAD_DES_ID: +#ifdef G_AI64 + case GLOAD_SQB_ID: +#endif if (!graph->node_mark){ graph->node_mark=1; mark_graph_2 (graph->instruction_parameters[1].p); @@ -154,6 +154,9 @@ void code_jsr_eval (int a_offset); void code_lnR (VOID); void code_load_i (CleanInt offset); void code_load_si16 (CleanInt offset); +#ifdef G_AI64 +void code_load_si32 (CleanInt offset); +#endif void code_load_ui8 (CleanInt offset); void code_log10R (VOID); void code_ltC (VOID); @@ -37,7 +37,7 @@ enum { ,GFSINCOS, GFRESULT0, GFRESULT1 #endif #ifdef G_AI64 - ,GLOAD_S_X, GSTORE_S_X + ,GLOAD_S_X, GSTORE_S_X, GLOAD_SQB_ID #endif #ifdef M68000 ,GFACOS, GFASIN, GFEXP, GFLN, GFLOG10 @@ -2413,6 +2413,9 @@ static void put_instructions_in_table (void) put_instruction_name ("lnR", parse_instruction, code_lnR ); put_instruction_name ("load_i", parse_instruction_i, code_load_i ); put_instruction_name ("load_si16", parse_instruction_i, code_load_si16 ); +#ifdef G_AI64 + put_instruction_name ("load_si32", parse_instruction_i, code_load_si32 ); +#endif put_instruction_name ("load_ui8", parse_instruction_i, code_load_ui8 ); put_instruction_name ("log10R", parse_instruction, code_log10R ); put_instruction_name ("ltC", parse_instruction, code_ltC ); diff --git a/cginstructions.c b/cginstructions.c index bd5c49d..45dab01 100644 --- a/cginstructions.c +++ b/cginstructions.c @@ -907,6 +907,20 @@ INSTRUCTION_GRAPH g_load_s_x (INSTRUCTION_GRAPH graph_1,int offset,int shift,INS return instruction; } + +INSTRUCTION_GRAPH g_load_sqb_id (int offset,INSTRUCTION_GRAPH graph_1) +{ + INSTRUCTION_GRAPH instruction; + + instruction=g_new_node (GLOAD_SQB_ID,0,2*sizeof (union instruction_parameter)); + + instruction->instruction_parameters[0].i=offset; + instruction->instruction_parameters[1].p=graph_1; + + graph_1->instruction_d_min_a_cost+=1; + + return instruction; +} #endif INSTRUCTION_GRAPH g_movem (int offset,INSTRUCTION_GRAPH graph_1,int n) @@ -6467,6 +6481,18 @@ void code_load_si16 (CleanInt offset) s_push_b (graph_2); } +#ifdef G_AI64 +void code_load_si32 (CleanInt offset) +{ + INSTRUCTION_GRAPH graph_1,graph_2; + + graph_1=s_pop_b (); + graph_2=g_load_sqb_id (offset,graph_1); + + s_push_b (graph_2); +} +#endif + void code_load_ui8 (CleanInt offset) { INSTRUCTION_GRAPH graph_1,graph_2; @@ -9055,6 +9055,34 @@ static void linearize_graph (INSTRUCTION_GRAPH graph,ADDRESS *ad_p) return; } +#ifdef G_AI64 + case GLOAD_SQB_ID: + { + ADDRESS ad_1; + int reg_1; + + linearize_graph (graph->instruction_parameters[1].p,&ad_1); + in_address_register (&ad_1); + + if (--*ad_1.ad_count_p==0) + free_aregister (ad_1.ad_register); + + if (graph->instruction_d_min_a_cost>0) + reg_1=get_aregister(); + else + reg_1=get_dregister(); + + i_loadsqb_id_r (graph->instruction_parameters[0].i,ad_1.ad_register,reg_1); + + if (graph->node_count>1) + register_node (graph,reg_1); + + ad_p->ad_mode=P_REGISTER; + ad_p->ad_register=reg_1; + ad_p->ad_count_p=&graph->node_count; + return; + } +#endif case GSTORE: { INSTRUCTION_GRAPH a_graph; |