Repository navigation
Give the PowerPC long double force_rounding operand as output and input - #69
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #69 +/- ##
========================================
Coverage 82.79% 82.79%
========================================
Files 23 23
Lines 1017 1017
Branches 412 412
========================================
Hits 842 842
Misses 167 167
Partials 8 8 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
The icpx-2025 job is failing on develop and master too. It isn't caused by this PR. Every release link fails with add.o: file not recognized: file format not recognized, while debug passes. b2 - bfgroup/b2#616 switched the intel-linux release compile flags from -O3 -ip to -O3 -ipo, which emits LTO bitcode, but the link step didn't pass -ipo. Should the CI be modified to include -ipo? @Lastique This is what it could be |
|
If the change in |
|
I think, gcc has issues when the same argument is used as separate input and output parameters in the asm statement; it may mess up register allocation and produce incorrect asm sometimes. Although in this case there is no asm to generate, so the issue may not manifest. Still, could you try adding an ",F" alternative to the original code? |
Tried. it just returns garbage value. |
668b440 to
d40d26a
Compare
You're compiling for x86_64, which has different register constraints. Though I'm not familiar with PPC64 asm to tell whether the code works there. There's also this alternative. Again, I can't easily tell from the asm whether it is working. |
I gave x86 because I can't read assembly so needed a printf proof and godbolt cant execute powerpc - but the point I wanted to make is just to say ,F doesnt work even on x86 () - I tested on QEMU locally I'll quickly test the other alternative you suggested |
|
@Lastique I tried - and it works - but then it does have nested if else? Maybe we keep the current one - one size fit all? |
|
I think, I'd rather prefer the one with a single input-output parameter than separate input and output parameters. It also makes the clang workaround more obvious. There already is an |
d40d26a to
f8e8f7a
Compare
|
Thanks. |
Fixes #66.
On ppc64le, GCC 9 to 14 reject the
long doubleforce_roundingasm added in #53 with "impossible constraint in 'asm'" when the value reaching it is a constant, for exampleinterval<long double>(6) / interval<long double>(2)in a function compiled at-O1or above. GCC cannot satisfy the in-out operand"+wa,d,m"with its several alternatives. Clang accepts it. #53 is onmaster, so this would ship in 1.93.Change: in
ppc_rounding_control.hpp, give the output and a matching input separately:"=wa,d,m"(r_) : "0,0,0"(r_). The alternatives and their order are unchanged, and the generated code for non-constant operands is identical (g++ -O2 -S, bothlong doubleABIs).Test:
test_constant<T>()intest/rounding_mode.cpp(float, double, long double), which runs on the three ppc64le CI jobs.rounding_mode.cppdoes not compile with GCC at-O2-O0,-O2and-O3