Uh oh!
There was an error while loading. Please reload this page.
JIT: Faster vector == Vector128.Zero on arm64 - #65632
Conversation
ghost
commented
Feb 20, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsCloses #63829 staticboolIsZero(Vector128<int>vec)=>vec==Vector128<int>.Zero;Codegen diff: ; Assembly listing for method IsZero(System.Runtime.Intrinsics.Vector128`1[Int32]):bool
stp fp, lr, [sp,#-16]!
mov fp, sp
- cmeq v16.4s, v0.4s, #0- uminv b16, v16.16b+ umaxv b16, v0.16b
umov w0, v16.b[0]
cmp w0, #0
- cset x0, ne+ cset x0, eq
ldp fp, lr, [sp],#16
ret lr
-; Total bytes of code 36+; Total bytes of code 32This is needed for faster IndexOf from #63285. Also, #65288 relies on it. Perf_Regex_Industry_RustLang_Sherlock Benchmark:
|
EgorBo
commented
Feb 20, 2022
PTAL @echesakovMSFT @TIHan |
EgorBo
commented
Feb 20, 2022
cc @vargaz@fanyang-mono the Test I added in this PR crashes on |
vargaz
commented
Feb 20, 2022
This will fix it: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TIHan
left a comment
There was a problem hiding this comment.
Looks good! Only a few comments.
I had created an issue to clean up the code for type checks of vector elements. Haven't get to it yet. (#65318) |
Uh oh!
There was an error while loading. Please reload this page.
| if (!varTypeIsFloating(simdBaseType) && (op != nullptr)) | ||
| { | ||
| GenTree* cmp = | ||
| comp->gtNewSimdHWIntrinsicNode(simdType, op, NI_AdvSimd_Arm64_MaxAcross, CORINFO_TYPE_UBYTE, simdSize); |
There was a problem hiding this comment.
According to Arm® Cortex®-A76 Software Optimization Guide:UMAXV, 16B has Exec latency 6 and Execution throughput 1/2
while UMAXV, 4H/4S has Exec latency 3 and Execution throughput 1
Do we want CORINFO_TYPE_USHORT/CORINFO_TYPE_UINT as a base type instead?
Improvements in dotnet/perf-autofiling-issues#3833 and dotnet/perf-autofiling-issues#3829 |
EgorBo
commented
Mar 3, 2022
wow, it's more than I expected |

Closes#63829
Codegen diff:
This is needed for faster IndexOf from #63285. Also, #65288 relies on it.
Perf_Regex_Industry_RustLang_Sherlock Benchmark:
Diffs