summaryrefslogtreecommitdiff
path: root/cgpas.c
diff options
context:
space:
mode:
authorJohn van Groningen2004-04-23 14:20:33 +0000
committerJohn van Groningen2004-04-23 14:20:33 +0000
commit07f581b742ee623014947b9c9ced8eb26c59603d (patch)
tree6f064e8fc905fbeb231c115cf1ceef24f0fd43bf /cgpas.c
parentport to gcc on Mac OS X (diff)
implement umulIIL instruction on the PowerPC
Diffstat (limited to 'cgpas.c')
-rw-r--r--cgpas.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cgpas.c b/cgpas.c
index 64d55af..a537926 100644
--- a/cgpas.c
+++ b/cgpas.c
@@ -547,6 +547,7 @@ static unsigned char real_reg_num [32] =
#define as_mtctr(rs) as_mtspr (9,rs)
#define as_mtspr(spr,rs) store_instruction ((31<<26)|(reg_num(rs)<<21)|(spr<<16)|(467<<1));
#define as_mulhw(rd,ra,rb) as_i_dab (rd,ra,rb,75)
+#define as_mulhwu(rd,ra,rb) as_i_dab (rd,ra,rb,11)
#define as_mulli(rd,ra,si) as_i_dai (7,rd,ra,si)
#define as_mullw(rd,ra,rb) as_i_dab (rd,ra,rb,235)
#define as_mullwo_(rd,ra,rb)as_i_dabo_ (rd,ra,rb,235)
@@ -1278,6 +1279,17 @@ static void as_mul_instruction (struct instruction *instruction)
as_mullw (r,r,reg);
}
+static void as_umulh_instruction (struct instruction *instruction)
+{
+ int r,reg;
+
+ r=instruction->instruction_parameters[1].parameter_data.reg.r;
+
+ reg=as_register_parameter (instruction->instruction_parameters[0],SIZE_LONG);
+
+ as_mulhwu (r,r,reg);
+}
+
static void as_mulo_instruction (struct instruction *instruction)
{
int r,reg;
@@ -2836,6 +2848,9 @@ static void write_instructions (struct instruction *instructions)
case IMULO:
as_mulo_instruction (instruction);
break;
+ case IUMULH:
+ as_umulh_instruction (instruction);
+ break;
default:
internal_error_in_function ("write_instructions");
}