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
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cmucl
cmucl
Commits
2cb914e9
Commit
2cb914e9
authored
Sep 15, 2015
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Implement PRINT vop
parent
6e427904
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/compiler/arm/print.lisp
+41
-2
41 additions, 2 deletions
src/compiler/arm/print.lisp
with
41 additions
and
2 deletions
src/compiler/arm/print.lisp
+
41
−
2
View file @
2cb914e9
...
...
@@ -18,9 +18,48 @@
(
define-vop
(
print
)
(
:args
(
object
:scs
(
descriptor-reg
any-reg
)))
(
:args
(
object
:scs
(
descriptor-reg
any-reg
)
:target
nl0
))
(
:results
(
result
:scs
(
descriptor-reg
)))
(
:save-p
t
)
(
:vop-var
vop
)
(
:temporary
(
:sc
any-reg
:offset
nl0-offset
:from
(
:argument
0
))
nl0
)
(
:temporary
(
:sc
non-descriptor-reg
)
temp
)
(
:temporary
(
:sc
any-reg
)
c-stack-pointer
)
(
:temporary
(
:sc
interior-reg
:offset
lip-offset
)
lip
)
(
:temporary
(
:sc
control-stack
:offset
nfp-save-offset
)
nfp-save
)
(
:generator
100
(
emit-not-implemented
)))
(
emit-not-implemented
)
(
let
((
cur-nfp
(
current-nfp-tn
vop
)))
(
when
cur-nfp
;; Save NFP to the Lisp stack
(
load-symbol-value
temp
*number-frame-pointer*
)
(
store-stack-tn
nfp-save
temp
))
;; Allocate space on the C stack. call_into_c expects at least
;; 5 arguments on the stack: the C function to be called, and 4
;; more words to be copied to r0-r3. That's 5 words on the
;; stack, but the AAPCS requires the stack to be on a
;; double-word boundary, so allocate 6 words.
(
load-symbol-value
c-stack-pointer
*number-stack-pointer*
)
(
inst
sub
c-stack-pointer
c-stack-pointer
(
*
6
vm:word-bytes
))
(
store-symbol-value
c-stack-pointer
*number-stack-pointer*
)
;; Save the object to the C stack. This is the first (and only)
;; arg to debug_print.
(
inst
str
object
c-stack-pointer
vm:word-bytes
)
;; Get address of debug_print. Then save to the C stack.
(
inst
li
temp
(
make-fixup
(
extern-alien-name
"debug_print"
)
:foreign
))
(
inst
str
temp
c-stack-pointer
0
)
;; Get address of call_into_c.
(
inst
li
temp
(
make-fixup
(
extern-alien-name
"call_into_c"
)
:foreign
))
;; Go!
(
inst
blx
temp
)
;; Back. Restore NFP
(
when
cur-nfp
(
load-stack-tn
temp
nfp-save
)
(
store-symbol-value
temp
*number-frame-pointer*
))
;; Put the single return value to the result
(
move
result
nl0
))))
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