-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Found one more delta to unbreak build for z/os #82789
base: main
Are you sure you want to change the base?
Changes from all commits
66989a1
1996816
6c45d60
eb3bd1b
b151da0
e4192b2
6c8c0ab
4815fdc
b3bcc70
fef5e08
5e87718
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -368,10 +368,11 @@ static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) { | |||||||
#endif | ||||||||
} | ||||||||
|
||||||||
#elif defined(QUAD_PRECISION) && defined(CRT_HAS_TF_MODE) | ||||||||
#elif defined(QUAD_PRECISION) | ||||||||
#if defined(CRT_HAS_TF_MODE) | ||||||||
#if defined(CRT_HAS_IEEE_TF) | ||||||||
Comment on lines
+372
to
+373
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Could we simplify this to just be
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that #if structure you suggest works with sparc. The logic of the sequence isn't semantically accurate either because the error in the else clause says all of the other conditions above are various TF mode and CRT_LDBL_128BIT is not one. We will also be losing the check for CRT_HAS_TF_MODE. The logic I tried to capture in my changes is "if has a TF mode pick the mode (or give an error), otherwise if has 128-bit long double ...". I don't think we can flatten this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRT_HAS_TF_MODE is defined as follows (f128 and int128):
CRT_HAS_F128 has two options: CRT_HAS_IEEE_TF or CRT_LDBL_128BIT so I believe these checks are equivalent. We only need the int128 support for the compiler-rt internal IEEE128 functions, for the non-IEEE we fall back to libc calls. So in my proposed structure, I believe this would work for 32-bit sparc: it has 128-bit float which is ieee but no int128. But since it also has 128-bit long double it would take the second branch and use the libc functions that don't depend on int128. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried out your proposed structure, and it works for z/OS. I'll make the change. Shall I change the wording in this:
The condition isn't entirely correct anymore since the If so, any suggestions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for testing! I guess we could do something more generic like "TF mode cannot be supported in current configuration", but keeping the current error seems fine to me. |
||||||||
// The generic implementation only works for ieee754 floating point. For other | ||||||||
// floating point types, continue to rely on the libm implementation for now. | ||||||||
#if defined(CRT_HAS_IEEE_TF) | ||||||||
static __inline tf_float __compiler_rt_logbtf(tf_float x) { | ||||||||
return __compiler_rt_logbX(x); | ||||||||
} | ||||||||
|
@@ -386,6 +387,9 @@ static __inline tf_float __compiler_rt_fmaxtf(tf_float x, tf_float y) { | |||||||
#define __compiler_rt_fmaxl __compiler_rt_fmaxtf | ||||||||
#define crt_fabstf crt_fabsf128 | ||||||||
#define crt_copysigntf crt_copysignf128 | ||||||||
#else | ||||||||
#error Unsupported TF mode type | ||||||||
#endif | ||||||||
#elif defined(CRT_LDBL_128BIT) | ||||||||
static __inline tf_float __compiler_rt_logbtf(tf_float x) { | ||||||||
return crt_logbl(x); | ||||||||
|
@@ -401,8 +405,6 @@ static __inline tf_float __compiler_rt_fmaxtf(tf_float x, tf_float y) { | |||||||
#define __compiler_rt_fmaxl crt_fmaxl | ||||||||
#define crt_fabstf crt_fabsl | ||||||||
#define crt_copysigntf crt_copysignl | ||||||||
#else | ||||||||
#error Unsupported TF mode type | ||||||||
#endif | ||||||||
|
||||||||
#endif // *_PRECISION | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand this conditional. Why do we need to check
COMPILER_RT_DEFAULT_TARGET_ARCH
?Also is the sparcv9 build 32-bit? If not could this be simplified to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I need @rorth feedback on. I don't know enough about the versions of sparc and what's supported or not. From the discussions, it sounded like "sparc" is 32-bit and the other
sparc*
are 64-bit.I think you are right. Hopefully Rainer, provides feedback too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @rorth . I think this is the only open issue blocking this from being merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've meanwhile tried 2-stage builds on both
sparcv9-sun-solaris2.11
andsparc64-unknown-linux-gnu
, each starting fromgcc-14
andclang-19
. There were no failures.However, the above is as wrong as it can get: on both Solaris/sparcv9 and Linux/sparc64 there were no
TF
filescompiled any longer, neither
sparc
norsparcv9
. For one, AFAICSMATCHES
isn't anchored, so it matches all ofsparc
,sparcv9
, andsparc64
. Besides, the concrete default SPARC target arch is completely irrelevant here: both a 64-bit-default compiler and a32-bit-default compiler can produce both 32 and 64-bit objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rorth. Can you provide a solution for this part that does what you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not right now. I seriously think we need to take two steps back first. So far, you haven't provided some quite crucial information:
main
?Right now, I can't help but feel that we've poking in the dark for months without any real progress or even understanding what the problem is. This is extremely tiring: I at least have long run out of energy, time, and patience about this patch. The upcoming releases of binutils 2.44, GCC 15, and LLVM 20 don't help in the slightest for this.
An added problem is the fact that to the best of my knowledge there's no public s390x system where one could try things for your target. OTOH, there's a Solaris/sparcv9 system in the cfarm that is perfectly capable of building and testing LLVM. I don't even know if there's any s390x ABI document available, so knowing the system's properties is all but impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arichardson has reviewed this and approves the change. In this case the changes recently made to divtc3.c and multc3.c had a bad assumption connecting native 128-bit long double support to 128-bit int support. That is not generally correct. I could simply reverse that but I know that will break sparc hence the change to this file.
The answers to the other questions are in previous PRs. I'll add the answers in the description of this one to save searching.