X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FMachCode.lhs;h=5939f60282f71605d2c9d14f0391535ac4acfaf9;hb=9e358c7e473ea6fdf8766b4944bc827adc41e5f0;hp=c1dd01a92ebc3550c6219a110b17576811730edf;hpb=4ceacc59b3353cc3be01b2416b32614274425dd2;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/MachCode.lhs b/ghc/compiler/nativeGen/MachCode.lhs index c1dd01a..5939f60 100644 --- a/ghc/compiler/nativeGen/MachCode.lhs +++ b/ghc/compiler/nativeGen/MachCode.lhs @@ -156,14 +156,17 @@ mangleIndexTree (StIndex pk base off) = StPrim IntAddOp [ base, let s = shift pk - in ASSERT(toInteger s == expectJust "MachCode" (exactLog2 (sizeOf pk))) - if s == 0 then off else StPrim SllOp [off, StInt s] + in if s == 0 then off else StPrim SllOp [off, StInt (toInteger s)] ] where - shift DoubleRep = 3::Integer - shift CharRep = 2::Integer - shift Int8Rep = 0::Integer - shift _ = IF_ARCH_alpha(3,2) + shift :: PrimRep -> Int + shift rep = case (fromInteger (sizeOf rep) :: Int) of + 1 -> 0 + 2 -> 1 + 4 -> 2 + 8 -> 3 + other -> pprPanic "MachCode.mangleIndexTree.shift: unhandled rep size" + (int other) \end{code} \begin{code}