Skip to content

Commit 76186a4

Browse files
committed
actually use a VOP
the cross-compiler is built knowing that some functions (usually as a result of code transformations) should never be compiled as calls, but should instead be /translated/ using one of our Virtual OPerations. DATA-VECTOR-REF, which the AREF in our scratch.lisp file translates to because of the type declarations, is one such function, so we need to define it: and also define it in such a way that it will be used no matter what the current compiler policy.
1 parent 506323c commit 76186a4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/compiler/rv32/array.lisp

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313

1414
(macrolet
1515
((def-full-data-vector-frobs (type element-type &rest scs)
16-
(let ((setname (symbolicate "DATA-VECTOR-SET/" type)))
16+
(let ((refname (symbolicate "DATA-VECTOR-REF/" type))
17+
(setname (symbolicate "DATA-VECTOR-SET/" type)))
1718
`(progn
19+
(define-full-reffer ,refname ,type
20+
vector-data-offset other-pointer-lowtag ,scs ,element-type data-vector-ref)
1821
(define-full-setter ,setname ,type
1922
vector-data-offset other-pointer-lowtag ,scs ,element-type data-vector-set))))
2023
(def-partial-data-vector-frobs (type element-type size signed &rest scs)

src/compiler/rv32/macros.lisp

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
`(progn
1616
(define-vop (,name)
1717
,@(when translate `((:translate ,translate)))
18+
(:policy :fast-safe)
1819
(:args (object :scs (descriptor-reg)) (index :scs (any-reg)))
1920
(:arg-types ,type tagged-num)
2021
(:results (value :scs ,scs))

0 commit comments

Comments
 (0)