X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FAbsCStixGen.lhs;h=2a3fe2d9059b2388bcc2ea7d3797c4e4cd5ca579;hb=b71148fc3dc7f89c92c144c8e2c30c3eada8a83d;hp=ebc7aeeb06e4e74d002abf422310c74a1d3e6f04;hpb=4e477c5857d64a10fd9701da3208102cb1b2e1f4;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/AbsCStixGen.lhs b/ghc/compiler/nativeGen/AbsCStixGen.lhs index ebc7aee..2a3fe2d 100644 --- a/ghc/compiler/nativeGen/AbsCStixGen.lhs +++ b/ghc/compiler/nativeGen/AbsCStixGen.lhs @@ -181,7 +181,7 @@ Here we handle top-level things, like @CCodeBlock@s and [ StLabel tmp_lbl , StAssign PtrRep stgSp (StIndex PtrRep stgSp (StInt (-1))) - , StJump (StInd WordRep stgSp) + , StJump NoDestInfo (StInd WordRep stgSp) ]) gentopcode absC @@ -348,22 +348,22 @@ which varies depending on whether we're profiling etc. \begin{code} gencode (CJump dest) - = returnUs (\xs -> StJump (a2stix dest) : xs) + = returnUs (\xs -> StJump NoDestInfo (a2stix dest) : xs) gencode (CFallThrough (CLbl lbl _)) = returnUs (\xs -> StFallThrough lbl : xs) gencode (CReturn dest DirectReturn) - = returnUs (\xs -> StJump (a2stix dest) : xs) + = returnUs (\xs -> StJump NoDestInfo (a2stix dest) : xs) gencode (CReturn table (StaticVectoredReturn n)) - = returnUs (\xs -> StJump dest : xs) + = returnUs (\xs -> StJump NoDestInfo dest : xs) where dest = StInd PtrRep (StIndex PtrRep (a2stix table) (StInt (toInteger (-n-fixedItblSize-1)))) gencode (CReturn table (DynamicVectoredReturn am)) - = returnUs (\xs -> StJump dest : xs) + = returnUs (\xs -> StJump NoDestInfo dest : xs) where dest = StInd PtrRep (StIndex PtrRep (a2stix table) dyn_off) dyn_off = StPrim IntSubOp [StPrim IntNegOp [a2stix am], @@ -506,14 +506,14 @@ be tuned.) highest = if floating then targetMaxDouble else targetMaxInt in ( - if False && -- jump tables disabled for now until the register allocator is - -- fixed to cope with them --SDM 18/8/2000 - not floating && choices > 4 && highTag - lowTag < toInteger (2 * choices) then + if not floating && choices > 4 + && highTag - lowTag < toInteger (2 * choices) + then mkJumpTable am' sortedAlts lowTag highTag udlbl else mkBinaryTree am' floating sortedAlts choices lowest highest udlbl ) - `thenUs` \ alt_code -> + `thenUs` \ alt_code -> gencode absC `thenUs` \ dflt_code -> returnUs (\xs -> alt_code (StLabel udlbl : dflt_code (StLabel ujlbl : xs))) @@ -557,8 +557,9 @@ already finish with a jump to the join point. cjmpHi = StCondJump dflt (StPrim IntGtOp [am, StInt (toInteger highTag)]) offset = StPrim IntSubOp [am, StInt lowTag] + dsts = DestInfo (dflt : map fst branches) - jump = StJump (StInd PtrRep (StIndex PtrRep (StCLbl utlbl) offset)) + jump = StJump dsts (StInd PtrRep (StIndex PtrRep (StCLbl utlbl) offset)) tlbl = StLabel utlbl table = StData PtrRep (mkTable branches [lowTag..highTag] []) in