Skip to content

Use current BFP rounding mode for s390x integer-to-double conversion - #131840

Open
abhishekabhi73cc-design wants to merge 1 commit into
dotnet:mainfrom
abhishekabhi73cc-design:test-m3-current-rounding
Open

abhishekabhi73cc-design wants to merge 1 commit into
dotnet:mainfrom
abhishekabhi73cc-design:test-m3-current-rounding

Conversation

@abhishekabhi73cc-design

Copy link
Copy Markdown
Contributor

The previous implementation explicitly encoded round-to-nearest, ties-to-even (M3 = 4) for the s390x integer-to-double conversion.

This change switches to M3 = 0, allowing the instruction to use the current BFP rounding mode. Since the CLI initializes the floating-point environment to IEEE-754 round-to-nearest and managed code cannot modify it, this preserves the required semantics while relying on the runtime-configured floating-point control state.

Verified by the existing BigInteger conversion regression tests.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 4, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@tannergooding

Copy link
Copy Markdown
Member

Why make this change? It seems like its strictly worse and risks introducing breakage for scenarios where the floating-point control word is modified.

If there is a form that allows strictly specifying the dedicated rounding mode per instruction, that seems like pure goodness (and on other architectures can actually be a minor perf improvement).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-VM-meta-mono community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants