Fix mulscc.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 12 Mar 2007 21:07:10 +0000 (17:07 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 12 Mar 2007 21:07:10 +0000 (17:07 -0400)
--HG--
extra : convert_revision : 405f10f14f2f6666a7bef01bfb0cf90ff14cef24

src/arch/sparc/isa/decoder.isa

index 178aafdfd1146d8ec9bc3520f3ef21bfaed06a19..556bb4bca212689c38b72a8368bbab31dab5d360 100644 (file)
@@ -426,19 +426,22 @@ decode OP default Unknown::unknown()
                 {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
             );
             0x24: mulscc({{
-                int64_t resTemp, multiplicand = Rs2_or_imm13;
-                int32_t multiplier = Rs1<31:0>;
                 int32_t savedLSB = Rs1<0:>;
-                multiplier = multiplier<31:1> |
-                    ((Ccr<3:3> ^ Ccr<1:1>) << 32);
-                if(!Y<0:>)
-                    multiplicand = 0;
-                Rd = resTemp = multiplicand + multiplier;
+
+                //Step 1
+                int64_t multiplicand = Rs2_or_imm13;
+                //Step 2
+                int32_t partialP = Rs1<31:1> |
+                    ((Ccr<3:3> ^ Ccr<1:1>) << 31);
+                //Step 3
+                int32_t added = Y<0:> ? multiplicand : 0;
+                Rd = partialP + added;
+                //Steps 4 & 5
                 Y = Y<31:1> | (savedLSB << 31);}},
-                {{((multiplicand<31:0> + multiplier<31:0>)<32:0>)}},
-                {{multiplicand<31:> == multiplier<31:> && multiplier<31:> != resTemp<31:>}},
-                {{((multiplicand >> 1) + (multiplier >> 1) + (multiplicand & multiplier & 0x1))<63:>}},
-                {{multiplicand<63:> == multiplier<63:> && multiplier<63:> != resTemp<63:>}}
+                {{((partialP<31:0> + added<31:0>)<32:0>)}},
+                {{partialP<31:> == added<31:> && added<31:> != Rd<31:>}},
+                {{((partialP >> 1) + (added >> 1) + (partialP & added & 0x1))<63:>}},
+                {{partialP<63:> == added<63:> && partialP<63:> != Rd<63:>}}
             );
         }
         format IntOp