Skip to content

[flang] Modifications to ieee_support_standard #125967

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

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

vdonaldson
Copy link
Contributor

The result of a call to ieee_support_halting is one of the components that affect the result of a call to ieee_support_standard.

The result of a call to ieee_support_halting is one of the components
that affect the result of a call to ieee_support_standard.
@vdonaldson vdonaldson requested a review from jeanPerier February 6, 2025 00:06
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Feb 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

@llvm/pr-subscribers-flang-semantics

Author: None (vdonaldson)

Changes

The result of a call to ieee_support_halting is one of the components that affect the result of a call to ieee_support_standard.


Full diff: https://github.com/llvm/llvm-project/pull/125967.diff

2 Files Affected:

  • (modified) flang/include/flang/Evaluate/target.h (+4-3)
  • (modified) flang/include/flang/Tools/TargetSetup.h (+2-2)
diff --git a/flang/include/flang/Evaluate/target.h b/flang/include/flang/Evaluate/target.h
index e07f916b875e06b..44c552b99cf4eaa 100644
--- a/flang/include/flang/Evaluate/target.h
+++ b/flang/include/flang/Evaluate/target.h
@@ -143,9 +143,10 @@ class TargetCharacteristics {
   std::string compilerOptionsString_;
   std::string compilerVersionString_;
   IeeeFeatures ieeeFeatures_{IeeeFeature::Denormal, IeeeFeature::Divide,
-      IeeeFeature::Flags, IeeeFeature::Inf, IeeeFeature::Io, IeeeFeature::NaN,
-      IeeeFeature::Rounding, IeeeFeature::Sqrt, IeeeFeature::Standard,
-      IeeeFeature::Subnormal, IeeeFeature::UnderflowControl};
+      IeeeFeature::Flags, IeeeFeature::Halting, IeeeFeature::Inf,
+      IeeeFeature::Io, IeeeFeature::NaN, IeeeFeature::Rounding,
+      IeeeFeature::Sqrt, IeeeFeature::Standard, IeeeFeature::Subnormal,
+      IeeeFeature::UnderflowControl};
 };
 
 } // namespace Fortran::evaluate
diff --git a/flang/include/flang/Tools/TargetSetup.h b/flang/include/flang/Tools/TargetSetup.h
index 5d23df6823a9485..d167f44fe2fd770 100644
--- a/flang/include/flang/Tools/TargetSetup.h
+++ b/flang/include/flang/Tools/TargetSetup.h
@@ -25,8 +25,6 @@ namespace Fortran::tools {
 
   const llvm::Triple &targetTriple{targetMachine.getTargetTriple()};
 
-  targetCharacteristics.set_ieeeFeature(evaluate::IeeeFeature::Halting, true);
-
   if (targetTriple.getArch() == llvm::Triple::ArchType::x86_64) {
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/3);
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/4);
@@ -37,6 +35,8 @@ namespace Fortran::tools {
     targetCharacteristics.set_haltingSupportIsUnknownAtCompileTime();
     targetCharacteristics.set_ieeeFeature(
         evaluate::IeeeFeature::Halting, false);
+    targetCharacteristics.set_ieeeFeature(
+        evaluate::IeeeFeature::Standard, false);
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/3);
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/4);
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/8);

Copy link
Contributor

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

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

LGTM, I added @kiranchandramohan and @pawosm-arm for visibility since this is about ARM.

@vdonaldson vdonaldson changed the title [flang] Modificaitons to ieee_support_standard [flang] Modifications to ieee_support_standard Feb 6, 2025
@vdonaldson vdonaldson merged commit b51fc2a into llvm:main Feb 7, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 7, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building flang at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/89/builds/16156

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Evaluate/fold-ieee.f90' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
Not assuming libpgmath support
Folding test failed:
test_std_4 .false._4
test_std_8 .false._4
test_std_all .false._4

FAIL

--
Command Output (stderr):
--
RUN: at line 1: "/usr/bin/python3.10" /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Evaluate/fold-ieee.f90 /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/bin/flang -fc1
+ /usr/bin/python3.10 /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Evaluate/fold-ieee.f90 /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/bin/flang -fc1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 7, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building flang at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/9666

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Evaluate/folding18.f90' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
Not assuming libpgmath support
Folding test failed:
test_ieee_support_standard .false._4

FAIL

--
Command Output (stderr):
--
RUN: at line 1: "/usr/bin/python3.10" /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Evaluate/folding18.f90 /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/bin/flang -fc1
+ /usr/bin/python3.10 /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Evaluate/folding18.f90 /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/bin/flang -fc1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 7, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-release running on linaro-flang-aarch64-release while building flang at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/172/builds/9337

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Evaluate/fold-ieee.f90' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
Not assuming libpgmath support
Folding test failed:
test_std_4 .false._4
test_std_8 .false._4
test_std_all .false._4

FAIL

--
Command Output (stderr):
--
RUN: at line 1: "/usr/bin/python3.10" /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Evaluate/fold-ieee.f90 /home/tcwg-buildbot/worker/flang-aarch64-release/build/bin/flang -fc1
+ /usr/bin/python3.10 /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Evaluate/test_folding.py /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Evaluate/fold-ieee.f90 /home/tcwg-buildbot/worker/flang-aarch64-release/build/bin/flang -fc1

--

********************


Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
The result of a call to ieee_support_halting is one of the components
that affect the result of a call to ieee_support_standard.
@tblah
Copy link
Contributor

tblah commented Feb 24, 2025

Since this commit (and the later fix for the buildbots), this Fujitsu test started failing on my aarch64 machine (printing "err") https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0136/0136_0045.f90

To reproduce compile and run the test file.

Please could you take a look.

@vdonaldson
Copy link
Contributor Author

Since this commit, this Fujitsu test started failing on my aarch64 machine (printing "err")

The Fujitsu test behavior was intentional because ieee_support_standard depends on ieee_support_halting, which may return false on Arm. But the test call is in executable code, so it may be possible to change this the same way the halting control call can return true in runtime code. I'll take another look. Thanks for the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants