Skip to content

Implement CEE_CKFINITE in the interpreter#119548

Merged
kg merged 1 commit intodotnet:mainfrom
kg:interp-ckfinite
Sep 10, 2025
Merged

Implement CEE_CKFINITE in the interpreter#119548
kg merged 1 commit intodotnet:mainfrom
kg:interp-ckfinite

Conversation

@kg
Copy link
Member

@kg kg commented Sep 10, 2025

Fixes JIT\Regression\JitBlue\DevDiv_370233 and JIT\Regression\JitBlue\DevDiv_377155. Unmasks a different failure in JIT\Regression\JitBlue\DevDiv_362706.

@kg kg requested a review from BrzVlad as a code owner September 10, 2025 18:52
Copilot AI review requested due to automatic review settings September 10, 2025 18:52
@kg kg requested a review from janvorli as a code owner September 10, 2025 18:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the CEE_CKFINITE instruction in the .NET interpreter, which validates that floating-point values are finite (not NaN or infinity) and throws an ArithmeticException if they are not. This fixes three JIT regression test failures.

Key changes:

  • Adds new CKFINITE interpreter opcodes for R4 (float) and R8 (double) types
  • Implements helper functions to validate finite values using std::isfinite
  • Integrates the CKFINITE instruction compilation and execution logic

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/interpexec.cpp Adds CkfiniteHelper functions and CKFINITE opcode execution cases
src/coreclr/interpreter/inc/intops.def Defines new INTOP_CKFINITE_R4 and INTOP_CKFINITE_R8 opcodes
src/coreclr/interpreter/compiler.cpp Implements CEE_CKFINITE instruction compilation logic

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@kg kg merged commit 7734cf0 into dotnet:main Sep 10, 2025
98 of 100 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants