guard the tests that assume 80-bit floating point type representation with macro,
so targets that assumes __fp128 (IEEE quad-precision floating type) will be skipped.
This patch address PR 32260 (https://bugs.llvm.org//show_bug.cgi?id=32260)
Differential D31573
[Builtins] Fix test cases for xf/ti weimingz on Apr 1 2017, 4:33 PM. Authored by
Details guard the tests that assume 80-bit floating point type representation with macro, This patch address PR 32260 (https://bugs.llvm.org//show_bug.cgi?id=32260)
Diff Detail Event TimelineComment Actions This doesn't make sense to me. XF *is* for modes with Intel extended precision. IEEE 128bit floats should be TF. Comment Actions That would be perfectly reasonable. Some other places already tag it with HAS_80_BIT_LONG_DOUBLE, but I don't know what is responsible for setting that macro. Comment Actions I guess HAS_80_BIT_LONG_DOUBLE is passed as some build-time flags. I can't find it anywhere in the compiler-rt source tree that defines it. I think we should guard it by checking "LDBL_MANT_DIG". Comment Actions Please do not drop checks for CRT_HAS_128BIT -- the code requirse__ int128_t and doesn't work on platforms without. Comment Actions If the platform doesn't support it, the LDBL_MANT_DIG will be 53 (refer to clang/test/Preprocessor/init.c ) Comment Actions
CRT_HAS_128BIT refers to support for 128-bit integers (__int128_t), which is unrelated to the size of long double. Comment Actions Change to HAS_80_BIT_LONG_DOUBLE just like other tests.
Comment Actions seems no way to detect if 80-bit ldbl is supported or not. Leave it to the build time flags. Comment Actions In my view, LDBL_MANT_DIG == 64 implies HAS_80_BIT_LONG_DOUBLE, but need t to exclude MIPS as it clang BE doesn't support it. Comment Actions There are two kinds of systems with 80-bit long double: 64-bit x86, and 32-bit x86. On 32-bit x86 with 80-bit long double, CRT_HAS_128BIT is false, and __LDBL_MANT_DIG__ is 64. On 64-bit x86 with 80-bit long double, CRT_HAS_128BIT is true, and __LDBL_MANT_DIG__ is 64. For the 80-bit long double tests which don't use 128-bit integers, you want to run them for all systems where LDBL_MANT_DIG is 64. For the 80-bit long double tests which do use 128-bit integers, you want to run them only on systems where CRT_HAS_128BIT is set and __LDBL_MANT_DIG__ is 64. Comment Actions these tests are the only 4 tests that use 128 bit long long. Comment Actions Actually, there are three platforms that use: i386, amd64 and m68k. The latter might not currently be supported by LLVM, but it still exists. In short, the combination of "TI mode" and "XF mode" is only amd64, "XF mode" applies to i386, amd64 and m68k. |