[flang] Corrected constant folding for IEEE_OTHER in IEEE_SUPPORT_ROUNDING (#197534)
Modified to report expected value of FALSE for constant folded IEEE_OTHER support. This fixes issue #197486.
This commit is contained in:
parent
6741bf0a02
commit
3def12d2a4
2 changed files with 3 additions and 1 deletions
|
|
@ -930,7 +930,7 @@ Expr<Type<TypeCategory::Logical, KIND>> FoldIntrinsicFunction(
|
|||
if (context.targetCharacteristics().ieeeFeatures().test(
|
||||
IeeeFeature::Rounding)) {
|
||||
if (auto mode{GetRoundingMode(args[0])}) {
|
||||
return Expr<T>{mode != common::RoundingMode::TiesAwayFromZero};
|
||||
return Expr<T>{mode < common::RoundingMode::TiesAwayFromZero};
|
||||
}
|
||||
}
|
||||
} else if (name == "__builtin_ieee_support_sqrt") {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ module m
|
|||
logical, parameter :: test_rd_u_all = ieee_support_rounding(ieee_up)
|
||||
logical, parameter :: test_rd_u_4 = ieee_support_rounding(ieee_up, 1.)
|
||||
logical, parameter :: test_rd_u_8 = ieee_support_rounding(ieee_up, 1.d0)
|
||||
logical, parameter :: test_rd_aw_not = .not. ieee_support_rounding(ieee_away)
|
||||
logical, parameter :: test_rd_ot_not = .not. ieee_support_rounding(ieee_other)
|
||||
logical, parameter :: test_sq_all = ieee_support_sqrt()
|
||||
logical, parameter :: test_sq_4 = ieee_support_sqrt(1.)
|
||||
logical, parameter :: test_sq_8 = ieee_support_sqrt(1.d0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue