compiler.cfg.instructions: ##select-vector instruction mapping to SSE4 PEXTR*
parent
5b48cd2a63
commit
645164188d
|
@ -310,6 +310,11 @@ def: dst
|
|||
use: src1/int-rep src2/int-rep src3/int-rep src4/int-rep
|
||||
literal: rep ;
|
||||
|
||||
PURE-INSN: ##select-vector
|
||||
def: dst/int-rep
|
||||
use: src
|
||||
literal: n rep ;
|
||||
|
||||
PURE-INSN: ##shuffle-vector
|
||||
def: dst
|
||||
use: src shuffle
|
||||
|
|
|
@ -184,6 +184,7 @@ CODEGEN: ##gather-vector-2 %gather-vector-2
|
|||
CODEGEN: ##gather-vector-4 %gather-vector-4
|
||||
CODEGEN: ##gather-int-vector-2 %gather-int-vector-2
|
||||
CODEGEN: ##gather-int-vector-4 %gather-int-vector-4
|
||||
CODEGEN: ##select-vector %select-vector
|
||||
CODEGEN: ##shuffle-vector-imm %shuffle-vector-imm
|
||||
CODEGEN: ##shuffle-vector-halves-imm %shuffle-vector-halves-imm
|
||||
CODEGEN: ##shuffle-vector %shuffle-vector
|
||||
|
|
|
@ -297,6 +297,7 @@ HOOK: %gather-vector-2 cpu ( dst src1 src2 rep -- )
|
|||
HOOK: %gather-int-vector-2 cpu ( dst src1 src2 rep -- )
|
||||
HOOK: %gather-vector-4 cpu ( dst src1 src2 src3 src4 rep -- )
|
||||
HOOK: %gather-int-vector-4 cpu ( dst src1 src2 src3 src4 rep -- )
|
||||
HOOK: %select-vector cpu ( dst src n rep -- )
|
||||
HOOK: %shuffle-vector cpu ( dst src shuffle rep -- )
|
||||
HOOK: %shuffle-vector-imm cpu ( dst src shuffle rep -- )
|
||||
HOOK: %shuffle-vector-halves-imm cpu ( dst src1 src2 shuffle rep -- )
|
||||
|
@ -354,6 +355,7 @@ HOOK: %gather-vector-2-reps cpu ( -- reps )
|
|||
HOOK: %gather-int-vector-2-reps cpu ( -- reps )
|
||||
HOOK: %gather-vector-4-reps cpu ( -- reps )
|
||||
HOOK: %gather-int-vector-4-reps cpu ( -- reps )
|
||||
HOOK: %select-vector-reps cpu ( -- reps )
|
||||
HOOK: %alien-vector-reps cpu ( -- reps )
|
||||
HOOK: %shuffle-vector-reps cpu ( -- reps )
|
||||
HOOK: %shuffle-vector-imm-reps cpu ( -- reps )
|
||||
|
@ -405,6 +407,7 @@ M: object %gather-vector-2-reps { } ;
|
|||
M: object %gather-int-vector-2-reps { } ;
|
||||
M: object %gather-vector-4-reps { } ;
|
||||
M: object %gather-int-vector-4-reps { } ;
|
||||
M: object %select-vector-reps { } ;
|
||||
M: object %alien-vector-reps { } ;
|
||||
M: object %shuffle-vector-reps { } ;
|
||||
M: object %shuffle-vector-imm-reps { } ;
|
||||
|
|
|
@ -781,6 +781,51 @@ M: x86.64 %gather-int-vector-2-reps
|
|||
{ sse4.1? { longlong-2-rep ulonglong-2-rep } }
|
||||
} available-reps ;
|
||||
|
||||
:: %select-vector-32 ( dst src n rep -- )
|
||||
rep {
|
||||
{ char-16-rep [
|
||||
dst 32-bit-version-of src n PEXTRB
|
||||
dst dst 8-bit-version-of MOVSX
|
||||
] }
|
||||
{ uchar-16-rep [
|
||||
dst 32-bit-version-of src n PEXTRB
|
||||
] }
|
||||
{ short-8-rep [
|
||||
dst 32-bit-version-of src n PEXTRW
|
||||
dst dst 16-bit-version-of MOVSX
|
||||
] }
|
||||
{ ushort-8-rep [
|
||||
dst 32-bit-version-of src n PEXTRW
|
||||
] }
|
||||
{ int-4-rep [
|
||||
dst 32-bit-version-of src n PEXTRD
|
||||
dst dst 32-bit-version-of 2dup = [ 2drop ] [ MOVSX ] if
|
||||
] }
|
||||
{ uint-4-rep [
|
||||
dst 32-bit-version-of src n PEXTRD
|
||||
] }
|
||||
} case ;
|
||||
|
||||
M: x86.32 %select-vector
|
||||
%select-vector-32 ;
|
||||
|
||||
M: x86.32 %select-vector-reps
|
||||
{
|
||||
{ sse4.1? { uchar-16-rep char-16-rep ushort-8-rep short-8-rep uint-4-rep int-4-rep } }
|
||||
} available-reps ;
|
||||
|
||||
M: x86.64 %select-vector
|
||||
{
|
||||
{ longlong-2-rep [ PEXTRQ ] }
|
||||
{ ulonglong-2-rep [ PEXTRQ ] }
|
||||
[ %select-vector-32 ]
|
||||
} case ;
|
||||
|
||||
M: x86.64 %select-vector-reps
|
||||
{
|
||||
{ sse4.1? { uchar-16-rep char-16-rep ushort-8-rep short-8-rep uint-4-rep int-4-rep ulonglong-2-rep longlong-2-rep } }
|
||||
} available-reps ;
|
||||
|
||||
: sse1-float-4-shuffle ( dst shuffle -- )
|
||||
{
|
||||
{ { 0 1 2 3 } [ drop ] }
|
||||
|
|
Loading…
Reference in New Issue