-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[RISC-V][JIT] Fix NaN canonicalization issue #88510
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3794,7 +3794,8 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, | |||||
if (op1->IsIntegralConst()) | ||||||
{ | ||||||
int32_t i32Cns = (int32_t)op1->AsIntConCommon()->IconValue(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
retNode = gtNewDconNode(*reinterpret_cast<float*>(&i32Cns), TYP_FLOAT); | ||||||
float f32Cns = *reinterpret_cast<float*>(&i32Cns); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Now that you're here... |
||||||
retNode = gtNewDconNode(FloatingPointUtils::convertToDouble(f32Cns), TYP_FLOAT); | ||||||
} | ||||||
else | ||||||
{ | ||||||
|
@@ -3834,7 +3835,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, | |||||
|
||||||
if (op1->IsCnsFltOrDbl()) | ||||||
{ | ||||||
float f32Cns = (float)op1->AsDblCon()->DconValue(); | ||||||
float f32Cns = FloatingPointUtils::convertToSingle(op1->AsDblCon()->DconValue()); | ||||||
retNode = gtNewIconNode(*reinterpret_cast<int32_t*>(&f32Cns)); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(since we're here anyways) |
||||||
} | ||||||
else | ||||||
|
@@ -4141,7 +4142,7 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic, | |||||
else | ||||||
{ | ||||||
assert(fromType == TYP_FLOAT); | ||||||
float f32Cns = static_cast<float>(op1->AsDblCon()->DconValue()); | ||||||
float f32Cns = FloatingPointUtils::convertToSingle(op1->AsDblCon()->DconValue()); | ||||||
return gtNewIconNode(static_cast<int32_t>(BitOperations::SingleToUInt32Bits(f32Cns))); | ||||||
} | ||||||
} | ||||||
|
@@ -4181,7 +4182,8 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic, | |||||
assert(toType == TYP_FLOAT); | ||||||
|
||||||
uint32_t u32Cns = static_cast<uint32_t>(op1->AsIntConCommon()->IconValue()); | ||||||
return gtNewDconNode(BitOperations::UInt32BitsToSingle(u32Cns), TYP_FLOAT); | ||||||
float f32Cns = BitOperations::UInt32BitsToSingle(u32Cns); | ||||||
return gtNewDconNode(FloatingPointUtils::convertToDouble(f32Cns), TYP_FLOAT); | ||||||
} | ||||||
} | ||||||
else | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.