-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Merged
kunalspathak
merged 45 commits into
dotnet:main
from
ebepho:ConvertTo_int64_single_double
Jun 29, 2024
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
c738b77
Added ConverToInt32 and ConvertToUInt32 for float inputs.
ebepho 35d39d9
Added flags to handle only low predicate registers.
ebepho 7a781e1
Fixed merge conflicts.
ebepho 1378d60
Fix whitespace
ebepho 10c7a15
Remove special codegen flag
ebepho 8004868
Added new test template for operations with different return types.
ebepho af7ccd4
Merge branch 'main' into ConvertToInt32
ebepho 8cb76da
Add new test template.
ebepho abe25fc
Added api for ConvertToInt32 and ConvertToUInt 32 for double.
ebepho 0f51f38
fix merge conflicts.
ebepho 7fabb91
Merge branch 'dotnet:main' into main
ebepho 11affed
Completed SVE Apis for ConvertToInt64 and ConvertToUInt64.
ebepho d5374ca
Merge branch 'main' of github.com:ebepho/runtime
ebepho 711b28a
Merge branch 'main' into converttoint64
ebepho fe32a2f
ConvertToSingle for int and uint.
ebepho 478b969
ConvertToSingle for long and ulong.
ebepho 4aa224d
Merge branch 'main' of github.com:ebepho/runtime
ebepho cc63edf
Merge branch 'main' into ConvertToSingleDouble
ebepho ff54068
Started ConvertToDouble.
ebepho 56601b4
Merge branch 'main' of github.com:ebepho/runtime
ebepho 422068b
Merge branch 'main' into converttoint64
ebepho 5b4c4f3
Changed Validation Template Test name.
ebepho 04071a3
Merge branch 'main' of github.com:ebepho/runtime
ebepho ffcd267
Merge branch 'main' of github.com:ebepho/runtime
ebepho d4b8dc3
Merge branch 'main' into converttoint64
ebepho 5ac4a05
Merge branch 'main' into converttosingledouble
ebepho f055d0c
Merge branch 'converttosingledouble' into ConvertTo_Int64_Single_Double
ebepho 33626b3
Merge branch 'main' of github.com:ebepho/runtime
ebepho 0327fa6
Merge branch 'main' into ConvertTo_Int64_Single_Double
ebepho da441d1
Merge branch 'main' of github.com:ebepho/runtime
ebepho 229017b
Merge branch 'main' into ConvertTo_Int64_Single_Double
ebepho f98fd84
Merge branch 'main' of github.com:ebepho/runtime
ebepho 51c9bf1
Merge branch 'main' into ConvertTo_Int64_Single_Double
ebepho 1e68ff6
Merge branch 'main' of github.com:ebepho/runtime
ebepho d053d13
Merge branch 'main' into ConvertTo_int64_single_double
ebepho b2a777e
ConvertToInt64.
ebepho 66abcaa
ConvertToInt64 passes optimized tests.
ebepho a0c7333
Added cases for ConvertToSingle and ConvertToDouble.
ebepho 37e1da1
double or long to 32 bit value.
ebepho 2c13be7
Removed ConvertToDouble and ConvertToSingle.
ebepho 2f3c901
Removed more of ConvertToSingle and ConvertToDouble.
ebepho 990c75b
all tests pass.
ebepho eaf3905
addressed comments.
ebepho 81f11cb
jit format:
kunalspathak c2d5d15
Remove trailing space
kunalspathak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,12 +492,22 @@ 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 = emitTypeSize(intrinEmbMask.baseType) == EA_8BYTE ? 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 = emitTypeSize(intrinEmbMask.baseType) == EA_4BYTE ? INS_OPTS_S_TO_D | ||
: INS_OPTS_SCALABLE_D; | ||
break; | ||
} | ||
default: | ||
|
@@ -536,7 +546,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 +561,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; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?