The real(10) is supported on x86_64. On aarch64, the value of
selected_real_kind(16) should be 16 rather than 10 since real(10)
is not supported on x86_64. Previously, the real type support check
is not target dependent. Support it now through the target triple
information.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Add "-triple aarch64-unknown-linux-gnu" to fix the CI fail. Do not know why the test case is still checked on Debian X86 even with ! REQUIRES: aarch64-registered-target.
! REQUIRES: <target> refers to the targets enabled when building LLVM rather than to the host machine on which the compiler is built. In the case of pre-commit CI, all available targets are enabled (i.e. the default value for LLVM_TARGETS_TO_BUILD is used):
-- Targeting AArch64 -- Targeting AMDGPU -- Targeting ARM -- Targeting AVR -- Targeting BPF -- Targeting Hexagon -- Targeting Lanai -- Targeting Mips -- Targeting MSP430 -- Targeting NVPTX -- Targeting PowerPC -- Targeting RISCV -- Targeting Sparc -- Targeting SystemZ -- Targeting VE -- Targeting WebAssembly -- Targeting X86 -- Targeting XCore
I think you should just call targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 10); from the driver when the target is set and the rest is already in place.
Got it. Thanks.
Good point. This will avoid adding new element to SemanticContext. Will fix the patch.
flang/module/__fortran_ieee_exceptions.f90 | ||
---|---|---|
46 | I'm not sure this is the right approach. It will not work when we do cross compilation (target is different than the host machine) since the target might have or not have support for real(10). |
flang/module/__fortran_ieee_exceptions.f90 | ||
---|---|---|
46 | You are right. I also have this question when I follow the previous implementation in flang/module/iso_c_binding.f90. I think this is only the temporary and fast solution to support quad on aarch64. The final solution for the cross-compilation might need fix the build scripts (CMakeLists.txt) for flang. |
flang/module/__fortran_ieee_exceptions.f90 | ||
---|---|---|
46 | Such a cross-compilation would properly define x86_64 or not, and that's the only architecture with x87 80-bit extended precision numbers. |
I'm not sure this is the right approach. It will not work when we do cross compilation (target is different than the host machine) since the target might have or not have support for real(10).