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
Reinier Maas
GHC
Commits
eae95873
Commit
eae95873
authored
15 years ago
by
Ian Lynagh
Browse files
Options
Downloads
Patches
Plain Diff
Use a bang pattern when we where/let-bind values with unlifted types
parent
5b413a66
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/integer-gmp/GHC/Integer.lhs
+8
-8
8 additions, 8 deletions
libraries/integer-gmp/GHC/Integer.lhs
with
8 additions
and
8 deletions
libraries/integer-gmp/GHC/Integer.lhs
+
8
−
8
View file @
eae95873
...
...
@@ -166,8 +166,8 @@ quotRemInteger (S# i) (S# j) = (# S# q, S# r #)
-- (# let q = i `quotInt#` j in S# q, ... #) which builds a
-- useless thunk. Placing the bindings here means they'll be
-- evaluated strictly.
q = i `quotInt#` j
r = i `remInt#` j
!
q = i `quotInt#` j
!
r = i `remInt#` j
quotRemInteger i1@(J# _ _) i2@(S# _) = quotRemInteger i1 (toBig i2)
quotRemInteger i1@(S# _) i2@(J# _ _) = quotRemInteger (toBig i1) i2
quotRemInteger (J# s1 d1) (J# s2 d2)
...
...
@@ -180,8 +180,8 @@ divModInteger a@(S# INT_MINBOUND) b = divModInteger (toBig a) b
divModInteger (S# i) (S# j) = (# S# d, S# m #)
where
-- NB. don't inline these. See quotRemInteger above.
d = i `divInt#` j
m = i `modInt#` j
!
d = i `divInt#` j
!
m = i `modInt#` j
-- XXX Copied from GHC.Base
divInt# :: Int# -> Int# -> Int#
...
...
@@ -196,7 +196,7 @@ divModInteger (S# i) (S# j) = (# S# d, S# m #)
((x# <# 0#) && (y# ># 0#))
then if r# /=# 0# then r# +# y# else 0#
else r#
where r# = x# `remInt#` y#
where
!
r# = x# `remInt#` y#
(&&) :: Bool -> Bool -> Bool
True && x = x
...
...
@@ -269,8 +269,8 @@ gcdInteger ia@(S# a) ib@(J# sb b)
= if a ==# 0# then absInteger ib
else if sb ==# 0# then absInteger ia
else S# (gcdIntegerInt# absSb b absA)
where absA = if a <# 0# then negateInt# a else a
absSb = if sb <# 0# then negateInt# sb else sb
where
!
absA = if a <# 0# then negateInt# a else a
!
absSb = if sb <# 0# then negateInt# sb else sb
gcdInteger ia@(J# _ _) ib@(S# _) = gcdInteger ib ia
gcdInteger (J# sa a) (J# sb b)
= case gcdInteger# sa a sb b of (# sg, g #) -> J# sg g
...
...
@@ -383,7 +383,7 @@ signumInteger (S# i) = if i <# 0# then S# -1#
else S# 1#
signumInteger (J# s d)
= let
cmp = cmpIntegerInt# s d 0#
!
cmp = cmpIntegerInt# s d 0#
in
if cmp ># 0# then S# 1#
else if cmp ==# 0# then S# 0#
...
...
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