Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Carl Shapiro
cmucl
Commits
5435083d
Commit
5435083d
authored
14 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Forgot to handle unbounded integer powers.
parent
03a535a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/float-tran.lisp
+27
-18
27 additions, 18 deletions
compiler/float-tran.lisp
with
27 additions
and
18 deletions
compiler/float-tran.lisp
+
27
−
18
View file @
5435083d
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.14
1
2010/08/18 1
4:55:5
1 rtoy
Exp
$"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.14
2
2010/08/18 1
5:39:0
1 rtoy
Rel
$"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1057,8 +1057,6 @@
(
if
(
interval-contains-p
y-even
y
)
y-even
nil
)))))
;; At least one of min-odd and min-even must be non-NIL!
(
assert
(
or
min-odd
min-even
))
(
cond
((
and
min-odd
min-even
)
;; The Y interval contains both even and odd
;; integers. Then the lower bound is (least
...
...
@@ -1089,25 +1087,32 @@
min-even
))
(
hi
(
safe-expt
(
bound-value
(
interval-low
x
))
min-even
)))
(
list
(
make-interval
:low
lo
:high
hi
)))))))
(
list
(
make-interval
:low
lo
:high
hi
))))
(
t
;; No mininum even or odd integer, so Y has no
;; lower bound
(
list
(
make-interval
:low
nil
:high
nil
))))))
(
handle-positive-power-1
(
x
y
)
;; X <= -1, Y is a positive integer. Find the largest even
;; and odd integer contained in Y, if possible.
(
let*
((
y-hi
(
bound-value
(
interval-high
y
)))
(
max-odd
(
if
(
oddp
y-hi
)
y-hi
(
let
((
y-odd
(
1-
y-hi
)))
(
if
(
interval-contains-p
y-odd
y
)
y-odd
nil
))))
(
max-even
(
if
(
evenp
y-hi
)
y-hi
(
let
((
y-even
(
1-
y-hi
)))
(
if
(
interval-contains-p
y-even
y
)
y-even
nil
)))))
(
max-odd
(
if
y-hi
(
if
(
oddp
y-hi
)
y-hi
(
let
((
y-odd
(
1-
y-hi
)))
(
if
(
interval-contains-p
y-odd
y
)
y-odd
nil
)))
nil
))
(
max-even
(
if
y-hi
(
if
(
evenp
y-hi
)
y-hi
(
let
((
y-even
(
1-
y-hi
)))
(
if
(
interval-contains-p
y-even
y
)
y-even
nil
)))
nil
)))
;; At least one of max-odd and max-even must be non-NIL!
(
assert
(
or
max-odd
max-even
))
(
cond
((
and
max-odd
max-even
)
;; The Y interval contains both even and odd
;; integers. Then the lower bound is (least
...
...
@@ -1136,7 +1141,11 @@
max-even
))
(
hi
(
safe-expt
(
bound-value
(
interval-low
x
))
max-even
)))
(
list
(
make-interval
:low
lo
:high
hi
))))))))
(
list
(
make-interval
:low
lo
:high
hi
))))
(
t
;; No maximum even or odd integer, which means y
;; is no upper bound.
(
list
(
make-interval
:low
nil
:high
nil
)))))))
;; We need to split into x < -1 and -1 <= x <= 0, first.
(
case
(
interval-range-info
x
-1
)
(
'+
...
...
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