From 5fa71251a083c3a47389012d8cc8ec3bd2c4c980 Mon Sep 17 00:00:00 2001 From: Gavin Romig-Koch Date: Tue, 10 Mar 1998 15:37:24 +0000 Subject: [PATCH] * vr4320.igen (clz,dclz) : Added. (dmac): Replaced 99, with LO. --- sim/mips/ChangeLog | 7 +++++++ sim/mips/vr4320.igen | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index dc421d94a15..cef52c2f38a 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,10 @@ +start-sanitize-vr4320 +Tue Mar 10 10:32:22 1998 Gavin Koch + + * vr4320.igen (clz,dclz) : Added. + (dmac): Replaced 99, with LO. + +end-sanitize-vr4320 start-sanitize-vr5400 Fri Mar 6 08:30:58 1998 Andrew Cagney diff --git a/sim/mips/vr4320.igen b/sim/mips/vr4320.igen index 7dd3776d248..50a9d02f3f0 100644 --- a/sim/mips/vr4320.igen +++ b/sim/mips/vr4320.igen @@ -60,9 +60,48 @@ "dmac r, r" *vr4320: { - LO = 99 + SignedMultiply (SD_, GPR[RS], GPR[RT]); + LO = LO + SignedMultiply (SD_, GPR[RS], GPR[RT]); } +// Count Leading Zeros +000000,5.RS,00000,5.RD,00000,110101::::CLZ +"clz r, r" +*vr4320: +{ + unsigned32 t = Low32Bits (SD_, GPR[RS]); + signed64 c = 0; + + while (! (t & ( 1 << 31)) + && c < 32) + { + c++; + t <<= 1; + } + + GPR[RD] = c; +} + +// D-Count Leading Zeros +000000,5.RS,00000,5.RD,00000,111101::::DCLZ +"dclz r, r" +*vr4320: +{ + unsigned64 t = GPR[RS]; + signed64 c = 0; + + while (! (t & ( (unsigned64)1 << 63)) + && c < 64) + { + c++; + t <<= 1; + } + + printf("lo %d\n", c); + GPR[RD] = c; +} + + + -- 2.30.2