[ Home ]
SBCL Internals

The pages on this CLiki-driven site can be edited by anybody at any time. No warranty of any kind can therefore be made; any implied warranties of merchantability or fitness for a particular purpose are expressly disclaimed
[ Home ] [ Recent Changes ] [ About CLiki ] [ Text Formatting ]

This email message by Christophe Rhodes came from here.

 Teemu Kalvas  writes:
 
 > I don"t understand the difference between define-vop
 > (data-vector-set/*) and define-vop (data-vector-set-c/*) but the
 > asymmetry of having a define-vop (data-vector-set/simple-string-c)
 > (instead of define-vop (data-vector-set-c/simple-string) which I
 > expected) in src/compiler/x86/array.lisp did strike me as odd.
 
 The names of most VOPs probably don"t have much effect, except that I
 suspect they want to be unique per-backend.  (I say "probably" because
 we"ve been surprised before about names being used where we don"t
 expect them to show up; I say "most" because there are some VOPs that
 are called by name: see, for example, some of the IR2 translators in
 src/compiler/ir2tran.lisp).
 
 VOP (aka "template") selection happens by comparing the derived
 argument or result types of a call (for instance, DATA-VECTOR-REF),
 with the templates held in the FUN-INFO-TEMPLATE slot of the return
 from (SB-INT:INFO :FUNCTION :INFO "SB-KERNEL:DATA-VECTOR-REF); so for
 instance, if we know we have a (SIMPLE-ARRAY BASE-CHAR (*)) and an
 SB-INT:INDEX, the DATA-VECTOR-REF/SIMPLE-ARRAY template (I"m
 guessing, but that"s probably close to its name on all platforms) will
 be applicable.
 
 Array-accessing VOPs generally come in two flavours, though; one can
 generally save some registers/instructions/time if the index is a
 compile-time constant.  In that case, the VOP generally named with a
 -C (though it need not be named like that; the important thing is that
 it will have a (:CONSTANT INDEX) in its :ARG-TYPES slot) will be used
 in preference (because its GENERATOR-COST is lower, typically put in
 by hand... there"s plenty that could be more automated in this area).
 
 So to wrap up, yes, the naming of the constant-case setter for string
 access on the x86 is inconsistent, but it"s not a behaviour bug
 (though fixing it, and probably defining an interface across backends
 so that the source becomes (a) easier to maintain and (b) easier to
 port, would not be viewed as wasted effort).
 
 Cheers,
 
 Christophe


This page is presently Uncategorized?: please add appropriate topic markers? and remove this text

This page is linked from: VOP  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively