]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/intrinsics/simd/simd.factor
Merge branch 'master' of git://github.com/slavapestov/factor
[factor.git] / basis / compiler / cfg / intrinsics / simd / simd.factor
1 ! Copyright (C) 2009 Slava Pestov, Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien alien.c-types byte-arrays fry
4 classes.algebra cpu.architecture kernel layouts math sequences
5 math.vectors math.vectors.simd.intrinsics
6 macros generalizations combinators combinators.short-circuit
7 arrays locals compiler.tree.propagation.info
8 compiler.cfg.builder.blocks
9 compiler.cfg.comparisons
10 compiler.cfg.stacks compiler.cfg.stacks.local compiler.cfg.hats
11 compiler.cfg.instructions compiler.cfg.registers
12 compiler.cfg.intrinsics
13 compiler.cfg.intrinsics.alien
14 compiler.cfg.intrinsics.simd.backend
15 specialized-arrays ;
16 FROM: alien.c-types => heap-size char short int longlong float double ;
17 SPECIALIZED-ARRAYS: char uchar short ushort int uint longlong ulonglong float double ;
18 IN: compiler.cfg.intrinsics.simd
19
20 ! compound vector ops
21
22 : sign-bit-mask ( rep -- byte-array )
23     signed-rep {
24         { char-16-rep [ uchar-array{
25             HEX: 80 HEX: 80 HEX: 80 HEX: 80
26             HEX: 80 HEX: 80 HEX: 80 HEX: 80
27             HEX: 80 HEX: 80 HEX: 80 HEX: 80
28             HEX: 80 HEX: 80 HEX: 80 HEX: 80
29         } underlying>> ] }
30         { short-8-rep [ ushort-array{
31             HEX: 8000 HEX: 8000 HEX: 8000 HEX: 8000
32             HEX: 8000 HEX: 8000 HEX: 8000 HEX: 8000
33         } underlying>> ] }
34         { int-4-rep [ uint-array{
35             HEX: 8000,0000 HEX: 8000,0000
36             HEX: 8000,0000 HEX: 8000,0000
37         } underlying>> ] }
38         { longlong-2-rep [ ulonglong-array{
39             HEX: 8000,0000,0000,0000
40             HEX: 8000,0000,0000,0000
41         } underlying>> ] }
42     } case ;
43
44 : ^load-neg-zero-vector ( rep -- dst )
45     {
46         { float-4-rep [ float-array{ -0.0 -0.0 -0.0 -0.0 } underlying>> ^^load-constant ] }
47         { double-2-rep [ double-array{ -0.0 -0.0 } underlying>> ^^load-constant ] }
48     } case ;
49
50 : ^load-add-sub-vector ( rep -- dst )
51     signed-rep {
52         { float-4-rep    [ float-array{ -0.0  0.0 -0.0  0.0 } underlying>> ^^load-constant ] }
53         { double-2-rep   [ double-array{ -0.0  0.0 } underlying>> ^^load-constant ] }
54         { char-16-rep    [ char-array{ -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 } underlying>> ^^load-constant ] }
55         { short-8-rep    [ short-array{ -1 0 -1 0 -1 0 -1 0 } underlying>> ^^load-constant ] }
56         { int-4-rep      [ int-array{ -1 0 -1 0 } underlying>> ^^load-constant ] }
57         { longlong-2-rep [ longlong-array{ -1 0 } underlying>> ^^load-constant ] }
58     } case ;
59
60 : ^load-half-vector ( rep -- dst )
61     {
62         { float-4-rep  [ float-array{  0.5 0.5 0.5 0.5 } underlying>> ^^load-constant ] }
63         { double-2-rep [ double-array{ 0.5 0.5 }         underlying>> ^^load-constant ] }
64     } case ;
65
66 : >variable-shuffle ( shuffle rep -- shuffle' )
67     rep-component-type heap-size
68     [ dup <repetition> >byte-array ]
69     [ iota >byte-array ] bi
70     '[ _ n*v _ v+ ] map concat ;
71
72 : ^load-immediate-shuffle ( shuffle rep -- dst )
73     >variable-shuffle ^^load-constant ;
74
75 :: ^blend-vector ( mask true false rep -- dst )
76     true mask rep ^^and-vector
77     mask false rep ^^andn-vector
78     rep ^^or-vector ;
79
80 : ^not-vector ( src rep -- dst )
81     {
82         [ ^^not-vector ]
83         [ [ ^^fill-vector ] [ ^^xor-vector ] bi ]
84     } v-vector-op ;
85
86 :: ^((compare-vector)) ( src1 src2 rep {cc,swap} -- dst )
87     {cc,swap} first2 :> ( cc swap? )
88     swap?
89     [ src2 src1 rep cc ^^compare-vector ]
90     [ src1 src2 rep cc ^^compare-vector ] if ;
91
92 :: ^(compare-vector) ( src1 src2 rep orig-cc -- dst )
93     rep orig-cc %compare-vector-ccs :> ( ccs not? )
94
95     ccs empty?
96     [ rep not? [ ^^fill-vector ] [ ^^zero-vector ] if ]
97     [
98         ccs unclip :> ( rest-ccs first-cc )
99         src1 src2 rep first-cc ^((compare-vector)) :> first-dst
100
101         rest-ccs first-dst
102         [ [ src1 src2 rep ] dip ^((compare-vector)) rep ^^or-vector ]
103         reduce
104
105         not? [ rep ^not-vector ] when
106     ] if ;
107
108 :: ^minmax-compare-vector ( src1 src2 rep cc -- dst )
109     cc order-cc {
110         { cc<  [ src1 src2 rep ^^max-vector src1 rep cc/= ^(compare-vector) ] }
111         { cc<= [ src1 src2 rep ^^min-vector src1 rep cc=  ^(compare-vector) ] }
112         { cc>  [ src1 src2 rep ^^min-vector src1 rep cc/= ^(compare-vector) ] }
113         { cc>= [ src1 src2 rep ^^max-vector src1 rep cc=  ^(compare-vector) ] }
114     } case ;
115
116 : ^compare-vector ( src1 src2 rep cc -- dst )
117     {
118         [ ^(compare-vector) ]
119         [ ^minmax-compare-vector ]
120         { unsigned-int-vector-rep [| src1 src2 rep cc |
121             rep sign-bit-mask ^^load-constant :> sign-bits
122             src1 sign-bits rep ^^xor-vector
123             src2 sign-bits rep ^^xor-vector
124             rep signed-rep cc ^(compare-vector)
125         ] }
126     } vv-cc-vector-op ;
127
128 : ^unpack-vector-head ( src rep -- dst )
129     {
130         [ ^^unpack-vector-head ]
131         { unsigned-int-vector-rep [ [ ^^zero-vector ] [ ^^merge-vector-head ] bi ] }
132         { signed-int-vector-rep [| src rep |
133             src src rep ^^merge-vector-head :> merged
134             rep rep-component-type heap-size 8 * :> bits
135             merged bits rep widen-vector-rep ^^shr-vector-imm
136         ] }
137         { signed-int-vector-rep [| src rep |
138             rep ^^zero-vector :> zero
139             zero src rep cc> ^compare-vector :> sign
140             src sign rep ^^merge-vector-head
141         ] }
142     } v-vector-op ;
143
144 : ^unpack-vector-tail ( src rep -- dst )
145     {
146         [ ^^unpack-vector-tail ]
147         [ [ ^^tail>head-vector ] [ ^^unpack-vector-head ] bi ]
148         { unsigned-int-vector-rep [ [ ^^zero-vector ] [ ^^merge-vector-tail ] bi ] }
149         { signed-int-vector-rep [| src rep |
150             src src rep ^^merge-vector-tail :> merged
151             rep rep-component-type heap-size 8 * :> bits
152             merged bits rep widen-vector-rep ^^shr-vector-imm
153         ] }
154         { signed-int-vector-rep [| src rep |
155             rep ^^zero-vector :> zero
156             zero src rep cc> ^compare-vector :> sign
157             src sign rep ^^merge-vector-tail
158         ] }
159     } v-vector-op ;
160
161 PREDICATE: fixnum-vector-rep < int-vector-rep
162     rep-component-type heap-size cell < ;
163
164 : ^(sum-vector-2) ( src rep -- dst )
165     {
166         [ dupd ^^horizontal-add-vector ]
167         [| src rep | 
168             src src rep ^^merge-vector-head :> head
169             src src rep ^^merge-vector-tail :> tail
170             head tail rep ^^add-vector
171         ]
172     } v-vector-op ;
173
174 : ^(sum-vector-4) ( src rep -- dst )
175     {
176         [
177             [ dupd ^^horizontal-add-vector ]
178             [ dupd ^^horizontal-add-vector ] bi
179         ]
180         [| src rep | 
181             src src rep ^^merge-vector-head :> head
182             src src rep ^^merge-vector-tail :> tail
183             head tail rep ^^add-vector :> src'
184
185             rep widen-vector-rep :> rep'
186             src' src' rep' ^^merge-vector-head :> head'
187             src' src' rep' ^^merge-vector-tail :> tail'
188             head' tail' rep ^^add-vector
189         ]
190     } v-vector-op ;
191
192 : ^(sum-vector-8) ( src rep -- dst )
193     {
194         [
195             [ dupd ^^horizontal-add-vector ]
196             [ dupd ^^horizontal-add-vector ]
197             [ dupd ^^horizontal-add-vector ] tri
198         ]
199         [| src rep | 
200             src src rep ^^merge-vector-head :> head
201             src src rep ^^merge-vector-tail :> tail
202             head tail rep ^^add-vector :> src'
203
204             rep widen-vector-rep :> rep'
205             src' src' rep' ^^merge-vector-head :> head'
206             src' src' rep' ^^merge-vector-tail :> tail'
207             head' tail' rep ^^add-vector :> src''
208
209             rep' widen-vector-rep :> rep''
210             src'' src'' rep'' ^^merge-vector-head :> head''
211             src'' src'' rep'' ^^merge-vector-tail :> tail''
212             head'' tail'' rep ^^add-vector
213         ]
214     } v-vector-op ;
215
216 : ^(sum-vector-16) ( src rep -- dst )
217     {
218         [
219             {
220                 [ dupd ^^horizontal-add-vector ]
221                 [ dupd ^^horizontal-add-vector ]
222                 [ dupd ^^horizontal-add-vector ]
223                 [ dupd ^^horizontal-add-vector ]
224             } cleave
225         ]
226         [| src rep | 
227             src src rep ^^merge-vector-head :> head
228             src src rep ^^merge-vector-tail :> tail
229             head tail rep ^^add-vector :> src'
230
231             rep widen-vector-rep :> rep'
232             src' src' rep' ^^merge-vector-head :> head'
233             src' src' rep' ^^merge-vector-tail :> tail'
234             head' tail' rep ^^add-vector :> src''
235
236             rep' widen-vector-rep :> rep''
237             src'' src'' rep'' ^^merge-vector-head :> head''
238             src'' src'' rep'' ^^merge-vector-tail :> tail''
239             head'' tail'' rep ^^add-vector :> src'''
240
241             rep'' widen-vector-rep :> rep'''
242             src''' src''' rep''' ^^merge-vector-head :> head'''
243             src''' src''' rep''' ^^merge-vector-tail :> tail'''
244             head''' tail''' rep ^^add-vector
245         ]
246     } v-vector-op ;
247
248 : ^(sum-vector) ( src rep -- dst )
249     [
250         dup rep-length {
251             {  2 [ ^(sum-vector-2) ] }
252             {  4 [ ^(sum-vector-4) ] }
253             {  8 [ ^(sum-vector-8) ] }
254             { 16 [ ^(sum-vector-16) ] }
255         } case
256     ] [ ^^vector>scalar ] bi ;
257
258 : ^sum-vector ( src rep -- dst )
259     {
260         { float-vector-rep [ ^(sum-vector) ] }
261         { fixnum-vector-rep [| src rep |
262             src rep ^unpack-vector-head :> head
263             src rep ^unpack-vector-tail :> tail
264             rep widen-vector-rep :> wide-rep
265             head tail wide-rep ^^add-vector wide-rep
266             ^(sum-vector)
267         ] }
268     } v-vector-op ;
269
270 : shuffle? ( obj -- ? ) { [ array? ] [ [ integer? ] all? ] } 1&& ;
271
272 : ^shuffle-vector-imm ( src1 shuffle rep -- dst )
273     [ rep-length 0 pad-tail ] keep {
274         [ ^^shuffle-vector-imm ]
275         [ [ ^load-immediate-shuffle ] [ ^^shuffle-vector ] bi ]
276     } vl-vector-op ;
277
278 : ^broadcast-vector ( src n rep -- dst )
279     [ rep-length swap <array> ] keep
280     ^shuffle-vector-imm ;
281
282 : ^with-vector ( src rep -- dst )
283     [ ^^scalar>vector ] keep [ 0 ] dip ^broadcast-vector ;
284
285 : ^select-vector ( src n rep -- dst )
286     [ ^broadcast-vector ] keep ^^vector>scalar ;
287
288 ! intrinsic emitters
289
290 : emit-simd-v+ ( node -- )
291     {
292         [ ^^add-vector ]
293     } emit-vv-vector-op ;
294
295 : emit-simd-v- ( node -- )
296     {
297         [ ^^sub-vector ]
298     } emit-vv-vector-op ;
299
300 : emit-simd-vneg ( node -- )
301     {
302         { float-vector-rep [ [ ^load-neg-zero-vector swap ] [ ^^sub-vector ] bi ] }
303         { int-vector-rep   [ [ ^^zero-vector         swap ] [ ^^sub-vector ] bi ] }
304     } emit-v-vector-op ;
305
306 : emit-simd-v+- ( node -- )
307     {
308         [ ^^add-sub-vector ]
309         { float-vector-rep [| src1 src2 rep |
310             rep ^load-add-sub-vector :> signs
311             src2 signs rep ^^xor-vector :> src2'
312             src1 src2' rep ^^add-vector
313         ] }
314         { int-vector-rep   [| src1 src2 rep |
315             rep ^load-add-sub-vector :> signs
316             src2  signs rep ^^xor-vector :> src2'
317             src2' signs rep ^^sub-vector :> src2''
318             src1 src2'' rep ^^add-vector
319         ] }
320     } emit-vv-vector-op ;
321
322 : emit-simd-vs+ ( node -- )
323     {
324         { float-vector-rep [ ^^add-vector ] }
325         { int-vector-rep [ ^^saturated-add-vector ] }
326     } emit-vv-vector-op ;
327
328 : emit-simd-vs- ( node -- )
329     {
330         { float-vector-rep [ ^^sub-vector ] }
331         { int-vector-rep [ ^^saturated-sub-vector ] }
332     } emit-vv-vector-op ;
333
334 : emit-simd-vs* ( node -- )
335     {
336         { float-vector-rep [ ^^mul-vector ] }
337         { int-vector-rep [ ^^saturated-mul-vector ] }
338     } emit-vv-vector-op ;
339
340 : emit-simd-v* ( node -- )
341     {
342         [ ^^mul-vector ]
343     } emit-vv-vector-op ;
344
345 : emit-simd-v*high ( node -- )
346     {
347         [ ^^mul-high-vector ]
348     } emit-vv-vector-op ;
349
350 : emit-simd-v*hs+ ( node -- )
351     {
352         [ ^^mul-horizontal-add-vector ]
353     } emit-vv-vector-op ;
354
355 : emit-simd-v/ ( node -- )
356     {
357         [ ^^div-vector ]
358     } emit-vv-vector-op ;
359
360 : emit-simd-vmin ( node -- )
361     {
362         [ ^^min-vector ]
363         [
364             [ cc< ^compare-vector ]
365             [ ^blend-vector ] 3bi
366         ]
367     } emit-vv-vector-op ;
368
369 : emit-simd-vmax ( node -- )
370     {
371         [ ^^max-vector ]
372         [
373             [ cc> ^compare-vector ]
374             [ ^blend-vector ] 3bi
375         ]
376     } emit-vv-vector-op ;
377
378 : emit-simd-vavg ( node -- )
379     {
380         [ ^^avg-vector ]
381         { float-vector-rep [| src1 src2 rep |
382             src1 src2 rep ^^add-vector
383             rep ^load-half-vector rep ^^mul-vector
384         ] }
385     } emit-vv-vector-op ;
386
387 : emit-simd-v. ( node -- )
388     {
389         [ ^^dot-vector ]
390         { float-vector-rep [ [ ^^mul-vector ] [ ^sum-vector ] bi ] }
391     } emit-vv-vector-op ;
392
393 : emit-simd-vsad ( node -- )
394     {
395         [
396             [ ^^sad-vector dup { 2 3 0 1 } int-4-rep ^^shuffle-vector-imm int-4-rep ^^add-vector ]
397             [ widen-vector-rep ^^vector>scalar ] bi
398         ]
399     } emit-vv-vector-op ;
400
401 : emit-simd-vsqrt ( node -- )
402     {
403         [ ^^sqrt-vector ]
404     } emit-v-vector-op ;
405
406 : emit-simd-sum ( node -- )
407     {
408         [ ^sum-vector ]
409     } emit-v-vector-op ;
410
411 : emit-simd-vabs ( node -- )
412     {
413         { unsigned-int-vector-rep [ drop ] }
414         [ ^^abs-vector ]
415         { float-vector-rep [ [ ^load-neg-zero-vector ] [ swapd ^^andn-vector ] bi ] }
416         { int-vector-rep [| src rep |
417             rep ^^zero-vector :> zero
418             zero src rep ^^sub-vector :> -src
419             zero src rep cc> ^compare-vector :> sign
420             sign -src src rep ^blend-vector
421         ] }
422     } emit-v-vector-op ;
423
424 : emit-simd-vand ( node -- )
425     {
426         [ ^^and-vector ]
427     } emit-vv-vector-op ;
428
429 : emit-simd-vandn ( node -- )
430     {
431         [ ^^andn-vector ]
432     } emit-vv-vector-op ;
433
434 : emit-simd-vor ( node -- )
435     {
436         [ ^^or-vector ]
437     } emit-vv-vector-op ;
438
439 : emit-simd-vxor ( node -- )
440     {
441         [ ^^xor-vector ]
442     } emit-vv-vector-op ;
443
444 : emit-simd-vnot ( node -- )
445     {
446         [ ^not-vector ]
447     } emit-v-vector-op ;
448
449 : emit-simd-vlshift ( node -- )
450     {
451         [ ^^shl-vector ]
452     } {
453         [ ^^shl-vector-imm ]
454     } [ integer? ] emit-vv-or-vl-vector-op ;
455
456 : emit-simd-vrshift ( node -- )
457     {
458         [ ^^shr-vector ]
459     } {
460         [ ^^shr-vector-imm ]
461     } [ integer? ] emit-vv-or-vl-vector-op ;
462
463 : emit-simd-hlshift ( node -- )
464     {
465         [ ^^horizontal-shl-vector-imm ]
466     } [ integer? ] emit-vl-vector-op ;
467
468 : emit-simd-hrshift ( node -- )
469     {
470         [ ^^horizontal-shr-vector-imm ]
471     } [ integer? ] emit-vl-vector-op ;
472
473 : emit-simd-vshuffle-elements ( node -- )
474     {
475         [ ^shuffle-vector-imm ]
476     } [ shuffle? ] emit-vl-vector-op ;
477
478 : emit-simd-vshuffle-bytes ( node -- )
479     {
480         [ ^^shuffle-vector ]
481     } emit-vv-vector-op ;
482
483 : emit-simd-vmerge-head ( node -- )
484     {
485         [ ^^merge-vector-head ]
486     } emit-vv-vector-op ;
487
488 : emit-simd-vmerge-tail ( node -- )
489     {
490         [ ^^merge-vector-tail ]
491     } emit-vv-vector-op ;
492
493 : emit-simd-v<= ( node -- )
494     {
495         [ cc<= ^compare-vector ]
496     } emit-vv-vector-op ;
497 : emit-simd-v< ( node -- )
498     {
499         [ cc< ^compare-vector ]
500     } emit-vv-vector-op ;
501 : emit-simd-v= ( node -- )
502     {
503         [ cc=  ^compare-vector ]
504     } emit-vv-vector-op ;
505 : emit-simd-v> ( node -- )
506     {
507         [ cc>  ^compare-vector ]
508     } emit-vv-vector-op ;
509 : emit-simd-v>= ( node -- )
510     {
511         [ cc>= ^compare-vector ]
512     } emit-vv-vector-op ;
513 : emit-simd-vunordered? ( node -- )
514     {
515         [ cc/<>= ^compare-vector ]
516     } emit-vv-vector-op ;
517
518 : emit-simd-vany? ( node -- )
519     {
520         [ vcc-any ^^test-vector ]
521     } emit-v-vector-op ;
522 : emit-simd-vall? ( node -- )
523     {
524         [ vcc-all ^^test-vector ]
525     } emit-v-vector-op ;
526 : emit-simd-vnone? ( node -- )
527     {
528         [ vcc-none ^^test-vector ]
529     } emit-v-vector-op ;
530
531 : emit-simd-v>float ( node -- )
532     {
533         { float-vector-rep [ drop ] }
534         { int-vector-rep [ ^^integer>float-vector ] }
535     } emit-v-vector-op ;
536
537 : emit-simd-v>integer ( node -- )
538     {
539         { float-vector-rep [ ^^float>integer-vector ] }
540         { int-vector-rep [ drop ] }
541     } emit-v-vector-op ;
542
543 : emit-simd-vpack-signed ( node -- )
544     {
545         [ ^^signed-pack-vector ]
546     } emit-vv-vector-op ;
547
548 : emit-simd-vpack-unsigned ( node -- )
549     {
550         [ ^^unsigned-pack-vector ]
551     } emit-vv-vector-op ;
552
553 : emit-simd-vunpack-head ( node -- )
554     {
555         [ ^unpack-vector-head ]
556     } emit-v-vector-op ;
557
558 : emit-simd-vunpack-tail ( node -- )
559     {
560         [ ^unpack-vector-tail ]
561     } emit-v-vector-op ;
562
563 : emit-simd-with ( node -- )
564     {
565         { fixnum-vector-rep [ ^with-vector ] }
566         { float-vector-rep  [ ^with-vector ] }
567     } emit-v-vector-op ;
568
569 : emit-simd-gather-2 ( node -- )
570     {
571         { fixnum-vector-rep [ ^^gather-vector-2 ] }
572         { float-vector-rep  [ ^^gather-vector-2 ] }
573     } emit-vv-vector-op ;
574
575 : emit-simd-gather-4 ( node -- )
576     {
577         { fixnum-vector-rep [ ^^gather-vector-4 ] }
578         { float-vector-rep  [ ^^gather-vector-4 ] }
579     } emit-vvvv-vector-op ;
580
581 : emit-simd-select ( node -- )
582     {
583         { fixnum-vector-rep [ ^select-vector ] }
584         { float-vector-rep  [ ^select-vector ] }
585     } [ integer? ] emit-vl-vector-op ;
586
587 : emit-alien-vector ( node -- )
588     dup [
589         '[
590             ds-drop prepare-alien-getter
591             _ ^^alien-vector ds-push
592         ]
593         [ inline-alien-getter? ] inline-alien
594     ] with { [ %alien-vector-reps member? ] } if-literals-match ;
595
596 : emit-set-alien-vector ( node -- )
597     dup [
598         '[
599             ds-drop prepare-alien-setter ds-pop
600             _ ##set-alien-vector
601         ]
602         [ byte-array inline-alien-setter? ]
603         inline-alien
604     ] with { [ %alien-vector-reps member? ] } if-literals-match ;
605
606 : enable-simd ( -- )
607     {
608         { (simd-v+)                [ emit-simd-v+                  ] }
609         { (simd-v-)                [ emit-simd-v-                  ] }
610         { (simd-vneg)              [ emit-simd-vneg                ] }
611         { (simd-v+-)               [ emit-simd-v+-                 ] }
612         { (simd-vs+)               [ emit-simd-vs+                 ] }
613         { (simd-vs-)               [ emit-simd-vs-                 ] }
614         { (simd-vs*)               [ emit-simd-vs*                 ] }
615         { (simd-v*)                [ emit-simd-v*                  ] }
616         { (simd-v*high)            [ emit-simd-v*high              ] }
617         { (simd-v*hs+)             [ emit-simd-v*hs+               ] }
618         { (simd-v/)                [ emit-simd-v/                  ] }
619         { (simd-vmin)              [ emit-simd-vmin                ] }
620         { (simd-vmax)              [ emit-simd-vmax                ] }
621         { (simd-vavg)              [ emit-simd-vavg                ] }
622         { (simd-v.)                [ emit-simd-v.                  ] }
623         { (simd-vsad)              [ emit-simd-vsad                ] }
624         { (simd-vsqrt)             [ emit-simd-vsqrt               ] }
625         { (simd-sum)               [ emit-simd-sum                 ] }
626         { (simd-vabs)              [ emit-simd-vabs                ] }
627         { (simd-vbitand)           [ emit-simd-vand                ] }
628         { (simd-vbitandn)          [ emit-simd-vandn               ] }
629         { (simd-vbitor)            [ emit-simd-vor                 ] }
630         { (simd-vbitxor)           [ emit-simd-vxor                ] }
631         { (simd-vbitnot)           [ emit-simd-vnot                ] }
632         { (simd-vand)              [ emit-simd-vand                ] }
633         { (simd-vandn)             [ emit-simd-vandn               ] }
634         { (simd-vor)               [ emit-simd-vor                 ] }
635         { (simd-vxor)              [ emit-simd-vxor                ] }
636         { (simd-vnot)              [ emit-simd-vnot                ] }
637         { (simd-vlshift)           [ emit-simd-vlshift             ] }
638         { (simd-vrshift)           [ emit-simd-vrshift             ] }
639         { (simd-hlshift)           [ emit-simd-hlshift             ] }
640         { (simd-hrshift)           [ emit-simd-hrshift             ] }
641         { (simd-vshuffle-elements) [ emit-simd-vshuffle-elements   ] }
642         { (simd-vshuffle-bytes)    [ emit-simd-vshuffle-bytes      ] }
643         { (simd-vmerge-head)       [ emit-simd-vmerge-head         ] }
644         { (simd-vmerge-tail)       [ emit-simd-vmerge-tail         ] }
645         { (simd-v<=)               [ emit-simd-v<=                 ] }
646         { (simd-v<)                [ emit-simd-v<                  ] }
647         { (simd-v=)                [ emit-simd-v=                  ] }
648         { (simd-v>)                [ emit-simd-v>                  ] }
649         { (simd-v>=)               [ emit-simd-v>=                 ] }
650         { (simd-vunordered?)       [ emit-simd-vunordered?         ] }
651         { (simd-vany?)             [ emit-simd-vany?               ] }
652         { (simd-vall?)             [ emit-simd-vall?               ] }
653         { (simd-vnone?)            [ emit-simd-vnone?              ] }
654         { (simd-v>float)           [ emit-simd-v>float             ] }
655         { (simd-v>integer)         [ emit-simd-v>integer           ] }
656         { (simd-vpack-signed)      [ emit-simd-vpack-signed        ] }
657         { (simd-vpack-unsigned)    [ emit-simd-vpack-unsigned      ] }
658         { (simd-vunpack-head)      [ emit-simd-vunpack-head        ] }
659         { (simd-vunpack-tail)      [ emit-simd-vunpack-tail        ] }
660         { (simd-with)              [ emit-simd-with                ] }
661         { (simd-gather-2)          [ emit-simd-gather-2            ] }
662         { (simd-gather-4)          [ emit-simd-gather-4            ] }
663         { (simd-select)            [ emit-simd-select              ] }
664         { alien-vector             [ emit-alien-vector             ] }
665         { set-alien-vector         [ emit-set-alien-vector         ] }
666         { assert-positive          [ drop                          ] }
667     } enable-intrinsics ;
668
669 enable-simd