Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
27c9fa78
Commit
27c9fa78
authored
25 years ago
by
Julian Seward
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-04-03 13:48:37 by sewardj]
Deal with MachWords, which recently have started appearing for unknown reasons.
parent
4a57b131
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/compiler/nativeGen/AbsCStixGen.lhs
+11
-9
11 additions, 9 deletions
ghc/compiler/nativeGen/AbsCStixGen.lhs
ghc/compiler/nativeGen/StixPrim.lhs
+4
-3
4 additions, 3 deletions
ghc/compiler/nativeGen/StixPrim.lhs
with
15 additions
and
12 deletions
ghc/compiler/nativeGen/AbsCStixGen.lhs
+
11
−
9
View file @
27c9fa78
...
...
@@ -29,14 +29,14 @@ import ClosureInfo ( infoTableLabelFromCI, entryLabelFromCI,
fastLabelFromCI, closureUpdReqd,
staticClosureNeedsLink
)
import Literal ( Literal(..) )
import Literal ( Literal(..)
, word2IntLit
)
import Maybes ( maybeToBool )
import PrimOp ( primOpNeedsWrapper, PrimOp(..) )
import PrimRep ( isFloatingRep, PrimRep(..) )
import StixInfo ( genCodeInfoTable, genBitmapInfoTable )
import StixMacro ( macroCode, checkCode )
import StixPrim ( primCode, amodeToStix, amodeToStix' )
import Outputable ( pprPanic )
import Outputable ( pprPanic
, ppr
)
import UniqSupply ( returnUs, thenUs, mapUs, getUniqueUs, UniqSM )
import Util ( naturalMergeSortLe )
import Panic ( panic )
...
...
@@ -449,14 +449,15 @@ be tuned.)
intTag :: Literal -> Integer
intTag (MachChar c) = toInteger (ord c)
intTag (MachInt i) = i
intTag _ = panic "intTag"
intTag (MachInt i) = i
intTag (MachWord w) = intTag (word2IntLit (MachWord w))
intTag _ = panic "intTag"
fltTag :: Literal -> Rational
fltTag (MachFloat f) = f
fltTag (MachFloat f)
= f
fltTag (MachDouble d) = d
fltTag
_
= panic "fltTag"
fltTag
x
= p
prP
anic "fltTag"
(ppr x)
{-
mkSimpleSwitches
...
...
@@ -493,9 +494,10 @@ be tuned.)
floating = isFloatingRep (getAmodeRep am)
choices = length alts
(x@(MachChar _),_) `leAlt` (y,_) = intTag x <= intTag y
(x@(MachInt _), _) `leAlt` (y,_) = intTag x <= intTag y
(x,_) `leAlt` (y,_) = fltTag x <= fltTag y
(x@(MachChar _),_) `leAlt` (y,_) = intTag x <= intTag y
(x@(MachInt _), _) `leAlt` (y,_) = intTag x <= intTag y
(x@(MachWord _), _) `leAlt` (y,_) = intTag x <= intTag y
(x,_) `leAlt` (y,_) = fltTag x <= fltTag y
\end{code}
...
...
This diff is collapsed.
Click to expand it.
ghc/compiler/nativeGen/StixPrim.lhs
+
4
−
3
View file @
27c9fa78
...
...
@@ -16,7 +16,7 @@ import AbsCSyn hiding ( spRel )
import AbsCUtils ( getAmodeRep, mixedTypeLocn )
import Constants ( uF_UPDATEE )
import SMRep ( fixedHdrSize )
import Literal ( Literal(..) )
import Literal ( Literal(..)
, word2IntLit
)
import CallConv ( cCallConv )
import PrimOp ( PrimOp(..), CCall(..), CCallTarget(..) )
import PrimRep ( PrimRep(..), isFloatingRep )
...
...
@@ -390,8 +390,9 @@ amodeToStix (CLit core)
MachChar c -> StInt (toInteger (ord c))
MachStr s -> StString s
MachAddr a -> StInt a
MachInt i -> StInt (toInteger i)
MachLitLit s _ -> {-trace (_UNPK_ s ++ "\n")-} (litLitToStix (_UNPK_ s))
MachInt i -> StInt i
MachWord w -> case word2IntLit core of MachInt iw -> StInt iw
MachLitLit s _ -> litLitToStix (_UNPK_ s)
MachFloat d -> StDouble d
MachDouble d -> StDouble d
_ -> panic "amodeToStix:core literal"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment