fix x86 %unpack-vector insns

db4
Joe Groff 2009-10-06 20:38:51 -05:00
parent a319dde8b5
commit 879fe9a665
3 changed files with 13 additions and 11 deletions
basis
compiler/cfg/instructions

View File

@ -303,11 +303,13 @@ literal: rep ;
PURE-INSN: ##unpack-vector-head
def: dst
use: src
temp: temp
literal: rep ;
PURE-INSN: ##unpack-vector-tail
def: dst
use: src
temp: temp
literal: rep ;
PURE-INSN: ##integer>float-vector
@ -813,8 +815,6 @@ UNION: def-is-use-insn
##box-displaced-alien
##compare-vector
##not-vector
##unpack-vector-head
##unpack-vector-tail
##string-nth
##unbox-any-c-ptr ;

View File

@ -234,8 +234,8 @@ HOOK: %merge-vector-head cpu ( dst src1 src2 rep -- )
HOOK: %merge-vector-tail cpu ( dst src1 src2 rep -- )
HOOK: %signed-pack-vector cpu ( dst src1 src2 rep -- )
HOOK: %unsigned-pack-vector cpu ( dst src1 src2 rep -- )
HOOK: %unpack-vector-head cpu ( dst src rep -- )
HOOK: %unpack-vector-tail cpu ( dst src rep -- )
HOOK: %unpack-vector-head cpu ( dst src temp rep -- )
HOOK: %unpack-vector-tail cpu ( dst src temp rep -- )
HOOK: %integer>float-vector cpu ( dst src rep -- )
HOOK: %float>integer-vector cpu ( dst src rep -- )
HOOK: %compare-vector cpu ( dst src1 src2 temp rep cc -- )

View File

@ -783,23 +783,25 @@ M: x86 %unsigned-pack-vector-reps
{ longlong-2-rep [ PCMPGTQ ] }
} case ;
:: (%unpack-vector-dest) ( dst src rep -- )
:: (%unpack-vector-signs) ( dst src rep -- )
dst rep signed-int-vector-rep?
[ src rep %sign-extension-vector ]
[ rep %zero-vector ] if ;
M: x86 %unpack-vector-head ( dst src rep -- )
[ (%unpack-vector-dest) ] 3keep
unsign-rep {
M:: x86 %unpack-vector-head ( dst src temp rep -- )
temp src rep (%unpack-vector-signs)
dst src rep %copy
dst temp rep unsign-rep {
{ char-16-rep [ PUNPCKLBW ] }
{ short-8-rep [ PUNPCKLWD ] }
{ int-4-rep [ PUNPCKLDQ ] }
{ longlong-2-rep [ PUNPCKLQDQ ] }
} case ;
M: x86 %unpack-vector-tail ( dst src rep -- )
[ (%unpack-vector-dest) ] 3keep
unsign-rep {
M:: x86 %unpack-vector-tail ( dst src temp rep -- )
temp src rep (%unpack-vector-signs)
dst src rep %copy
dst temp rep unsign-rep {
{ char-16-rep [ PUNPCKHBW ] }
{ short-8-rep [ PUNPCKHWD ] }
{ int-4-rep [ PUNPCKHDQ ] }