Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cmucl
cmucl
Commits
5435083d
Commit
5435083d
authored
Aug 18, 2010
by
rtoy
Browse files
Forgot to handle unbounded integer powers.
parent
03a535a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/float-tran.lisp
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
)
(
'+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment