-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
Description
As per dotnet/coreclr#20788 (comment), using BitConverter.SingleToInt32Bits, BitConverter.Int32BitsToSingle, BitConverter.DoubleToInt64Bits, and BitConverter.Int64BitsToDouble generates some "inefficient" code.
Currently BitConverter.SingleToInt32Bits is generating:
vmovss dword ptr [rsp+14H], xmm0
mov eax, dword ptr [rsp+14H]When it could generate:
vmovd eax, xmm0Currently BitConverter.Int32BitsToSingle is generating:
mov dword ptr [rsp+0CH], eax
vmovss xmm0, dword ptr [rsp+0CH]When it could generate:
vmovd xmm0, eaxThe same logic applies to double <-> long, but using the rax register and vmovq.
- For x86, it can use the
movq xmm, [m64]ormovq [m64], xmmencoding
category:cq
theme:casts
skill-level:intermediate
cost:medium
voinokin, juliusfriedman, PaulusParssinen, omariom, Sergio0694 and 2 more
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization