Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit baeed0c

Browse files
committed
Adding support for the SSE MoveMask intrinsic
1 parent dee8fb7 commit baeed0c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/jit/hwintrinsiccodegenxarch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node)
548548
emit->emitIns_SIMD_R_R_R(INS_movlhps, targetReg, op1Reg, op2Reg, TYP_SIMD16);
549549
break;
550550

551+
case NI_SSE_MoveMask:
552+
assert(baseType == TYP_FLOAT);
553+
emit->emitIns_SIMD_R_R(INS_movmskps, targetReg, op1Reg, TYP_INT);
554+
break;
555+
551556
case NI_SSE_MoveScalar:
552557
assert(baseType == TYP_FLOAT);
553558
op2Reg = op2->gtRegNum;

src/jit/hwintrinsicxarch.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,14 @@ GenTree* Compiler::impSSEIntrinsic(NamedIntrinsic intrinsic,
616616
break;
617617
}
618618

619+
case NI_SSE_MoveMask:
620+
assert(sig->numArgs == 1);
621+
assert(JITtype2varType(sig->retType) == TYP_INT);
622+
assert(getBaseTypeOfSIMDType(info.compCompHnd->getArgClass(sig, sig->args)) == TYP_FLOAT);
623+
op1 = impSIMDPopStack(TYP_SIMD16);
624+
retNode = gtNewSimdHWIntrinsicNode(TYP_INT, op1, intrinsic, TYP_FLOAT, 16);
625+
break;
626+
619627
case NI_SSE_StaticCast:
620628
{
621629
assert(sig->numArgs == 1);

src/jit/instrsxarch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ INST3( movupd, "movupd" , 0, IUM_WR, 0, 0, PCKDBL(0x11), BAD_CODE, PCK
206206
INST3( movups, "movups" , 0, IUM_WR, 0, 0, PCKFLT(0x11), BAD_CODE, PCKFLT(0x10))
207207
INST3( movhlps, "movhlps" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, PCKFLT(0x12))
208208
INST3( movlhps, "movlhps" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, PCKFLT(0x16))
209+
INST3( movmskps, "movmskps" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, PCKFLT(0x50))
209210
INST3( unpckhps, "unpckhps" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, PCKFLT(0x15))
210211
INST3( unpcklps, "unpcklps" , 0, IUM_WR, 0, 0, BAD_CODE, BAD_CODE, PCKFLT(0x14))
211212

0 commit comments

Comments
 (0)