Skip to content
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

Optimize ckfinite for modern baselines. #48022

Open
tannergooding opened this issue Feb 8, 2021 · 0 comments
Open

Optimize ckfinite for modern baselines. #48022

tannergooding opened this issue Feb 8, 2021 · 0 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue
Milestone

Comments

@tannergooding
Copy link
Member

tannergooding commented Feb 8, 2021

As per #47843 (comment), Ckfinite is currently doing manual bit manipulation to check if a floating-point value is finite.

Given that SSE2 and AdvSimd are the required baselines for RyuJIT, we should look at optimizing the output of this instruction to just use the optimal codegen.

Notably, this can be done as effectively:

andnot value, -0.0  ; Get absolute value
cmp value, +inf     ; Compare with +infinity
setne result        ; Set if not equal to true

On x86, these would be andnps and ucomiss respectively and functions given that nan never compares equal to any other value, so we only need to check if the absolute value is or is not infinity.

category:cq
theme:codegen
skill-level:intermediate
cost:medium
impact:small

@tannergooding tannergooding added the tenet-performance Performance related issue label Feb 8, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Feb 8, 2021
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Feb 10, 2021
@JulieLeeMSFT JulieLeeMSFT added this to the Future milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

2 participants