use swapd in a few places.
parent
325d1bac2a
commit
54cca48aca
|
@ -287,7 +287,7 @@ SIMD-INTRINSIC: (simd-with) ( n rep -- v )
|
||||||
underlying>> ;
|
underlying>> ;
|
||||||
SIMD-INTRINSIC: (simd-gather-2) ( m n rep -- v ) <rep-array> [ 2 set-firstn-unsafe ] keep underlying>> ;
|
SIMD-INTRINSIC: (simd-gather-2) ( m n rep -- v ) <rep-array> [ 2 set-firstn-unsafe ] keep underlying>> ;
|
||||||
SIMD-INTRINSIC: (simd-gather-4) ( m n o p rep -- v ) <rep-array> [ 4 set-firstn-unsafe ] keep underlying>> ;
|
SIMD-INTRINSIC: (simd-gather-4) ( m n o p rep -- v ) <rep-array> [ 4 set-firstn-unsafe ] keep underlying>> ;
|
||||||
SIMD-INTRINSIC: (simd-select) ( a n rep -- x ) [ swap ] dip byte>rep-array nth-unsafe ;
|
SIMD-INTRINSIC: (simd-select) ( a n rep -- x ) swapd byte>rep-array nth-unsafe ;
|
||||||
|
|
||||||
SIMD-INTRINSIC: alien-vector ( c-ptr n rep -- value )
|
SIMD-INTRINSIC: alien-vector ( c-ptr n rep -- value )
|
||||||
[ swap <displaced-alien> ] dip rep-size memory>byte-array ;
|
[ swap <displaced-alien> ] dip rep-size memory>byte-array ;
|
||||||
|
|
|
@ -43,7 +43,7 @@ SYNTAX: PAIR-GENERIC: (PAIR-GENERIC:) ;
|
||||||
|
|
||||||
: define-pair-method ( a b pair-generic definition -- )
|
: define-pair-method ( a b pair-generic definition -- )
|
||||||
[ 2array ] 2dip swap
|
[ 2array ] 2dip swap
|
||||||
[ "pair-generic-methods" word-prop [ swap ] dip set-at ]
|
[ "pair-generic-methods" word-prop swapd set-at ]
|
||||||
[ make-pair-generic ] bi ;
|
[ make-pair-generic ] bi ;
|
||||||
|
|
||||||
: ?prefix-swap ( quot ? -- quot' )
|
: ?prefix-swap ( quot ? -- quot' )
|
||||||
|
|
|
@ -10,7 +10,7 @@ TUPLE: push-insn value ;
|
||||||
GENERIC: eval-insn ( stack insn -- stack )
|
GENERIC: eval-insn ( stack insn -- stack )
|
||||||
|
|
||||||
: binary-op ( stack quot: ( x y -- z ) -- stack )
|
: binary-op ( stack quot: ( x y -- z ) -- stack )
|
||||||
[ uncons uncons [ swap ] dip ] dip dip cons ; inline
|
[ uncons uncons swapd ] dip dip cons ; inline
|
||||||
|
|
||||||
M: add-insn eval-insn drop [ + ] binary-op ;
|
M: add-insn eval-insn drop [ + ] binary-op ;
|
||||||
M: sub-insn eval-insn drop [ - ] binary-op ;
|
M: sub-insn eval-insn drop [ - ] binary-op ;
|
||||||
|
|
|
@ -34,7 +34,7 @@ MACRO: set-slot ( name -- quot: ( value tuple -- ) )
|
||||||
! Chainable setters
|
! Chainable setters
|
||||||
|
|
||||||
: set-slot* ( tuple value name -- tuple )
|
: set-slot* ( tuple value name -- tuple )
|
||||||
[ swap ] dip '[ _ set-slot ] keep ; inline
|
swapd '[ _ set-slot ] keep ; inline
|
||||||
|
|
||||||
: change-slot* ( tuple name quot: ( ..a old -- ..b new ) -- ..b tuple )
|
: change-slot* ( tuple name quot: ( ..a old -- ..b new ) -- ..b tuple )
|
||||||
'[ _ _ change-slot ] keep ; inline
|
'[ _ _ change-slot ] keep ; inline
|
||||||
|
@ -43,6 +43,7 @@ MACRO: set-slot ( name -- quot: ( value tuple -- ) )
|
||||||
|
|
||||||
MACRO: slots ( names -- quot: ( tuple -- values... ) )
|
MACRO: slots ( names -- quot: ( tuple -- values... ) )
|
||||||
[ '[ _ slot ] ] { } map-as '[ _ cleave ] ;
|
[ '[ _ slot ] ] { } map-as '[ _ cleave ] ;
|
||||||
|
|
||||||
MACRO: {slots} ( names -- quot: ( tuple -- {values} ) )
|
MACRO: {slots} ( names -- quot: ( tuple -- {values} ) )
|
||||||
dup length '[ _ slots _ narray ] ;
|
dup length '[ _ slots _ narray ] ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue