-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arm64/SVE: Implemented ConvertToint64
and ConvertToUInt64
#104069
Changes from 37 commits
c738b77
35d39d9
7a781e1
1378d60
10c7a15
8004868
af7ccd4
8cb76da
abe25fc
0f51f38
7fabb91
11affed
d5374ca
711b28a
fe32a2f
478b969
4aa224d
cc63edf
ff54068
56601b4
422068b
5b4c4f3
04071a3
ffcd267
d4b8dc3
5ac4a05
f055d0c
33626b3
0327fa6
da441d1
229017b
f98fd84
51c9bf1
1e68ff6
d053d13
b2a777e
66abcaa
a0c7333
37e1da1
2c13be7
2f3c901
990c75b
eaf3905
81f11cb
c2d5d15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,12 +492,19 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) | |
|
||
// Special handling for ConvertTo* APIs | ||
// Just need to change the opt here. | ||
insOpts embOpt = opt; | ||
switch (intrinEmbMask.id) | ||
{ | ||
case NI_Sve_ConvertToInt32: | ||
case NI_Sve_ConvertToUInt32: | ||
{ | ||
opt = intrinEmbMask.baseType == TYP_DOUBLE ? INS_OPTS_D_TO_S : INS_OPTS_SCALABLE_S; | ||
embOpt = intrinEmbMask.baseType == TYP_DOUBLE ? INS_OPTS_D_TO_S : INS_OPTS_SCALABLE_S; | ||
break; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs handling of embOpt = intrinEmbMask.baseType == TYP_DOUBLE ? INS_OPTS_D_TO_S : INS_OPTS_SCALABLE_S; and embOpt = intrinEmbMask.baseType == TYP_FLOAT ? INS_OPTS_S_TO_D : INS_OPTS_SCALABLE_D; which means you can combine |
||
case NI_Sve_ConvertToInt64: | ||
case NI_Sve_ConvertToUInt64: | ||
{ | ||
embOpt = intrinEmbMask.baseType == TYP_FLOAT ? INS_OPTS_S_TO_D : INS_OPTS_SCALABLE_D; | ||
break; | ||
} | ||
default: | ||
|
@@ -536,7 +543,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) | |
|
||
// We cannot use use `movprfx` here to move falseReg to targetReg because that will | ||
// overwrite the value of embMaskOp1Reg which is present in targetReg. | ||
GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); | ||
GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, | ||
embOpt); | ||
|
||
GetEmitter()->emitIns_R_R_R_R(INS_sve_sel, emitSize, targetReg, maskReg, targetReg, | ||
falseReg, opt); | ||
|
@@ -550,7 +558,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) | |
} | ||
} | ||
|
||
GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); | ||
GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, embOpt); | ||
break; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3388,8 +3388,10 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) | |
|
||
// For now, make sure that we get here only for intrinsics that we are | ||
// sure about to rely on auxiliary type's size. | ||
assert((embOp->GetHWIntrinsicId() == NI_Sve_ConvertToInt32) || | ||
(embOp->GetHWIntrinsicId() == NI_Sve_ConvertToUInt32)); | ||
assert((embOp->GetHWIntrinsicId() == NI_Sve_ConvertToInt32) || | ||
(embOp->GetHWIntrinsicId() == NI_Sve_ConvertToUInt32) || | ||
(embOp->GetHWIntrinsicId() == NI_Sve_ConvertToInt64) || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise here. |
||
(embOp->GetHWIntrinsicId() == NI_Sve_ConvertToUInt64)); | ||
|
||
uint32_t auxSize = genTypeSize(embOp->GetAuxiliaryType()); | ||
if (maskSize == auxSize) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected to have entries for
ConvertToSingle
andConvertToDouble
here as well. Did you confirm this works for scenario wheremaskSize != operSize
in lowering?