-
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
JIT: Bad codegen with Avx512DQ.VL.Range
#106610
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Preview 7 is ok G_M000_IG01: ;; offset=0x0000
sub esp, 32
G_M000_IG02: ;; offset=0x0003
vxorps ymm0, ymm0, ymm0
vrangeps ymm0, ymm0, ymmword ptr [@RWD00], 0
vmovups ymmword ptr [esp], ymm0
mov ecx, 0x8B3C8AC
call CORINFO_HELP_NEWSFAST
vmovups ymm0, ymmword ptr [esp]
vmovups ymmword ptr [eax+0x04], ymm0
mov ecx, eax
call [System.Console:WriteLine(System.Object)]
G_M000_IG03: ;; offset=0x0033
vzeroupper
add esp, 32
ret
RWD00 dq 00000000FFA00000h, 0000000000000000h, 0000000000000000h, 0000000000000000h but recent builds are not G_M27646_IG01: ;; offset=0x0000
sub esp, 32
;; size=3 bbWeight=1 PerfScore 0.25
G_M27646_IG02: ;; offset=0x0003
vxorps ymm0, ymm0, ymm0
vrangeps ymm0, ymm0, ymmword ptr [@RWD00], 0
vmovups ymmword ptr [esp], ymm0
mov ecx, 0xB6632E0 ; System.Runtime.Intrinsics.Vector256`1[uint]
call CORINFO_HELP_NEWSFAST
vmovups ymm0, ymmword ptr [esp]
vmovups ymmword ptr [eax+0x04], ymm0
mov ecx, eax
call [System.Console:WriteLine(System.Object)]
;; size=48 bbWeight=1 PerfScore 16.83
G_M27646_IG03: ;; offset=0x0033
vzeroupper
add esp, 32
ret
;; size=7 bbWeight=1 PerfScore 2.25
RWD00 dq 00000000FFE00000h, 0000000000000000h, 0000000000000000h, 0000000000000000h Only diff is the value in |
becomes
so somehow an extra bit gets set in the vector constant (FFE instead of FFA). |
Looks like this is nan normalization? 0xFFA00000 is a nan float, and we normalize it to 0xFFE00000. |
Not quite NaN normalization, but rather
In general we (RyuJIT) try and avoid any explicit normalization and instead try to explicitly propagate wherever applicable (that is, if a |
So this is somewhat expected behavior, but it would still be interesting to find out what is causing the CPU to see it as an |
The path we take is:
|
👍, so we'd need to intercept this prir to extracting the scalar value out of the SIMD input (that is prior to I think the simplest place to do that is I can get a fix up for this. |
Ok, I will reassign this one to you. |
cc @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: