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
6ab11152
Commit
6ab11152
authored
21 years ago
by
toy
Browse files
Options
Downloads
Patches
Plain Diff
Add a deftransform for ABS so that if the arg is known to be non-negative
we don't have to call abs at all.
parent
feaa7104
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
+10
-1
10 additions, 1 deletion
compiler/float-tran.lisp
with
10 additions
and
1 deletion
compiler/float-tran.lisp
+
10
−
1
View file @
6ab11152
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.9
6
2004/01/
09 04:20:59
toy Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.9
7
2004/01/
10 05:01:41
toy Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -591,6 +591,15 @@
...
@@ -591,6 +591,15 @@
(
coerce
(
imagpart
x
)
'double-float
))
(
coerce
(
imagpart
x
)
'double-float
))
'single-float
))
'single-float
))
(
deftransform
abs
((
x
)
(
real
)
real
)
(
let
((
x-type
(
continuation-type
x
)))
;; If the arg is known to non-negative, we can just return the
;; arg. However, (abs -0.0) is 0.0, so this transform only works
;; on floats that are known not to include negative zero.
(
if
(
csubtypep
x-type
(
specifier-type
'
(
or
(
rational
0
)
(
float
(
0d0
))
(
member
0f0
0d0
))))
'x
(
give-up
))))
(
deftransform
phase
((
x
)
((
complex
double-float
))
double-float
:when
:both
)
(
deftransform
phase
((
x
)
((
complex
double-float
))
double-float
:when
:both
)
'
(
%atan2
(
imagpart
x
)
(
realpart
x
)))
'
(
%atan2
(
imagpart
x
)
(
realpart
x
)))
...
...
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