diff options
author | John van Groningen | 2006-03-24 10:54:16 +0000 |
---|---|---|
committer | John van Groningen | 2006-03-24 10:54:16 +0000 |
commit | 23753df2ab585ad7fdedce28b0edf6ec36357805 (patch) | |
tree | 5189634ddaf5a252822587353e5ba59221a7270d /cgcode.c | |
parent | fix entier for 64 bit processors (diff) |
optimize shift n bitand 31 or 64 for IA32 and AMD64
Diffstat (limited to 'cgcode.c')
-rw-r--r-- | cgcode.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -7166,12 +7166,41 @@ void code_set_finalizers (VOID) } #endif +#ifdef I486 +static INSTRUCTION_GRAPH remove_and_31_or_63 (INSTRUCTION_GRAPH graph) +{ + if (graph->instruction_parameters[0].p->instruction_code==GLOAD_I && +# ifndef G_A64 + graph->instruction_parameters[0].p->instruction_parameters[0].i==31) +# else + graph->instruction_parameters[0].p->instruction_parameters[0].i==63) +# endif + { + return graph->instruction_parameters[1].p; + } + if (graph->instruction_parameters[1].p->instruction_code==GLOAD_I && +# ifndef G_A64 + graph->instruction_parameters[1].p->instruction_parameters[0].i==31) +# else + graph->instruction_parameters[1].p->instruction_parameters[0].i==63) +# endif + { + return graph->instruction_parameters[0].p; + } + return graph; +} +#endif + void code_shiftl (VOID) { INSTRUCTION_GRAPH graph_1,graph_2,graph_3; graph_1=s_pop_b(); graph_2=s_get_b (0); +#ifdef I486 + if (graph_2->instruction_code==GAND) + graph_2=remove_and_31_or_63 (graph_2); +#endif graph_3=g_lsl (graph_2,graph_1); s_put_b (0,graph_3); @@ -7183,6 +7212,10 @@ void code_shiftr (VOID) graph_1=s_pop_b(); graph_2=s_get_b (0); +#ifdef I486 + if (graph_2->instruction_code==GAND) + graph_2=remove_and_31_or_63 (graph_2); +#endif graph_3=g_asr (graph_2,graph_1); s_put_b (0,graph_3); @@ -7194,6 +7227,10 @@ void code_shiftrU (VOID) graph_1=s_pop_b(); graph_2=s_get_b (0); +#ifdef I486 + if (graph_2->instruction_code==GAND) + graph_2=remove_and_31_or_63 (graph_2); +#endif graph_3=g_lsr (graph_2,graph_1); s_put_b (0,graph_3); |