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
30c18d86
Commit
30c18d86
authored
35 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Added fast-ash-fixnum=>fixnum VOP.
parent
c8054de1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/mips/arith.lisp
+60
-1
60 additions, 1 deletion
compiler/mips/arith.lisp
with
60 additions
and
1 deletion
compiler/mips/arith.lisp
+
60
−
1
View file @
30c18d86
...
...
@@ -56,7 +56,6 @@
(
:results
(
r
:scs
(
any-reg
descriptor-reg
)))
(
:effects
)
(
:affected
)
(
:note
"inline fixnum arithmetic"
)
(
:policy
:fast-safe
))
(
defmacro
define-fixnum-binop
((
name
translate
cost
result-type
)
...
...
@@ -75,6 +74,8 @@
'zero
)))))
(
:translate
,
translate
)
(
:result-types
,
result-type
)
,@
(
when
(
eq
result-type
t
)
'
((
:note
"inline fixnum arithmetic"
)))
(
:generator
,
cost
(
sc-case
y
((
any-reg
descriptor-reg
)
...
...
@@ -114,6 +115,64 @@
xor
:immed-op
xori
:unsigned
t
)
;;; Shifting
(
define-vop
(
fast-ash/fixnum=>fixnum
)
(
:note
"inline fixnum arithmetic"
)
(
:args
(
number
:scs
(
any-reg
descriptor-reg
)
:target
num
)
(
amount
:scs
(
any-reg
descriptor-reg
immediate
negative-immediate
zero
)
:target
ndesc
))
(
:arg-types
fixnum
fixnum
)
(
:results
(
result
:scs
(
any-reg
descriptor-reg
)))
(
:result-types
fixnum
)
(
:translate
ash
)
(
:policy
:fast-safe
)
(
:temporary
(
:scs
(
any-reg
)
:type
fixnum
:from
(
:argument
0
))
num
)
(
:temporary
(
:scs
(
non-descriptor-reg
)
:type
random
:from
(
:argument
1
))
ndesc
foo
)
(
:node-var
node
)
(
:generator
3
(
sc-case
amount
((
any-reg
descriptor-reg
)
(
let
((
negative
(
gen-label
))
(
very-negative
(
gen-label
))
(
done
(
gen-label
)))
(
move
num
number
)
(
inst
bltz
amount
negative
)
(
inst
sra
ndesc
amount
2
)
;; The fixnum result-type assures us that this shift will not overflow.
(
inst
sllv
result
num
ndesc
)
(
emit-label
done
)
(
unassemble
(
assemble-elsewhere
node
(
emit-label
negative
)
(
inst
nor
ndesc
ndesc
ndesc
)
(
inst
addiu
ndesc
ndesc
3
)
(
inst
andi
foo
ndesc
#x1f
)
(
inst
beq
foo
ndesc
very-negative
)
(
inst
srav
ndesc
num
ndesc
)
(
b
done
)
(
inst
sll
result
ndesc
2
)
(
emit-label
very-negative
)
(
inst
sra
ndesc
num
31
)
(
b
done
)
(
inst
sll
result
ndesc
2
)))))
(
immediate
(
inst
sll
result
number
(
tn-value
amount
)))
(
negative-immediate
(
inst
sra
ndesc
number
(
min
31
(
+
2
(
abs
(
tn-value
amount
)))))
(
inst
sll
result
ndesc
2
))
(
zero
;; Someone should have optimized this away.
(
move
result
number
)))))
;;; Multiply and Divide.
(
define-vop
(
fast-*/fixnum=>fixnum
fast-binop
)
...
...
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