deps: V8: backport 8521e2e77535 - #65898
Open
luyahan wants to merge 1 commit into
Open
Conversation
Original commit message:
[riscv]Fix unordered FP comparison and emit at the consumer
The lowering for kFloatLessThanOrUnordered and
kFloatLessThanOrEqualOrUnordered incorrectly mapped to (LT, true)
and (LE, true), respectively. Since ComputeBranchInfo can negate a
branch condition after emitting the comparison, complementary
conditions must use the same comparison and invert its predicate.
The incorrect mappings dropped the negation, breaking NaN semantics.
For example, optimized Wasm loops like
`do { x += 1.0; } while (!(x > 0.0));` produced wrong results.
Fix the mappings: kFloatLessThanOrUnordered now uses negated GE,
and kFloatLessThanOrEqualOrUnordered uses negated GT. To prevent
this class of bug, also convert kRiscvCmpS and kRiscvCmpD into
pseudo-instructions like the integer kRiscvCmp. The actual
comparison is now emitted at the single flags consumer (branch,
boolean materialization, or select) through the new EmitFPCompare
helper, using the consumer's final FlagsCondition. This ensures
the predicate and machine condition are resolved consistently.
Generated code remains byte-identical.
Bug: 557938134
Change-Id: I230e181753c5e9c6e7fbea651e551192a76e4005
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8360836
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#109690}
Refs: v8/v8@8521e2e
Co-authored-by: LuYahan <yahan@iscas.ac.cn>
Collaborator
|
Review requested:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original commit message:
Refs: v8/v8@8521e2e