only emit ##alien-vector/##set-alien-vector insns if the rep is available
							parent
							
								
									1407804393
								
							
						
					
					
						commit
						97ab9dc4ab
					
				| 
						 | 
				
			
			@ -128,6 +128,9 @@ MACRO: if-literals-match ( quots -- )
 | 
			
		|||
    [ ^^select-vector ] [unary/param]
 | 
			
		||||
    { [ integer? ] [ representation? ] } if-literals-match ; inline
 | 
			
		||||
 | 
			
		||||
: emit-alien-vector-op ( node quot: ( rep -- ) -- )
 | 
			
		||||
    { [ %alien-vector-reps member? ] } if-literals-match ; inline
 | 
			
		||||
 | 
			
		||||
: emit-alien-vector ( node -- )
 | 
			
		||||
    dup [
 | 
			
		||||
        '[
 | 
			
		||||
| 
						 | 
				
			
			@ -135,7 +138,7 @@ MACRO: if-literals-match ( quots -- )
 | 
			
		|||
            _ ^^alien-vector ds-push
 | 
			
		||||
        ]
 | 
			
		||||
        [ inline-alien-getter? ] inline-alien
 | 
			
		||||
    ] with emit-vector-op ;
 | 
			
		||||
    ] with emit-alien-vector-op ;
 | 
			
		||||
 | 
			
		||||
: emit-set-alien-vector ( node -- )
 | 
			
		||||
    dup [
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +148,7 @@ MACRO: if-literals-match ( quots -- )
 | 
			
		|||
        ]
 | 
			
		||||
        [ byte-array inline-alien-setter? ]
 | 
			
		||||
        inline-alien
 | 
			
		||||
    ] with emit-vector-op ;
 | 
			
		||||
    ] with emit-alien-vector-op ;
 | 
			
		||||
 | 
			
		||||
: generate-not-vector ( src rep -- dst )
 | 
			
		||||
    dup %not-vector-reps member?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -289,6 +289,7 @@ HOOK: %zero-vector-reps cpu ( -- reps )
 | 
			
		|||
HOOK: %fill-vector-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %gather-vector-2-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %gather-vector-4-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %alien-vector-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %shuffle-vector-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %shuffle-vector-imm-reps cpu ( -- reps )
 | 
			
		||||
HOOK: %merge-vector-reps cpu ( -- reps )
 | 
			
		||||
| 
						 | 
				
			
			@ -330,6 +331,7 @@ M: object %zero-vector-reps { } ;
 | 
			
		|||
M: object %fill-vector-reps { } ;
 | 
			
		||||
M: object %gather-vector-2-reps { } ;
 | 
			
		||||
M: object %gather-vector-4-reps { } ;
 | 
			
		||||
M: object %alien-vector-reps { } ;
 | 
			
		||||
M: object %shuffle-vector-reps { } ;
 | 
			
		||||
M: object %shuffle-vector-imm-reps { } ;
 | 
			
		||||
M: object %merge-vector-reps { } ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -562,6 +562,12 @@ MACRO: available-reps ( alist -- )
 | 
			
		|||
    reverse [ { } ] suffix
 | 
			
		||||
    '[ _ cond ] ;
 | 
			
		||||
 | 
			
		||||
M: x86 %alien-vector-reps
 | 
			
		||||
    {
 | 
			
		||||
        { sse? { float-4-rep } }
 | 
			
		||||
        { sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
 | 
			
		||||
    } available-reps ;
 | 
			
		||||
 | 
			
		||||
M: x86 %zero-vector
 | 
			
		||||
    {
 | 
			
		||||
        { double-2-rep [ dup XORPD ] }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue