-
Notifications
You must be signed in to change notification settings - Fork 32
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
Implement more TFmode builtins #121
Conversation
In addition to AARCH64_BUILTIN_HUGE_VALQ AARCH64_BUILTIN_INFQ we add AARCH64_BUILTIN_COPYSIGNQ AARCH64_BUILTIN_FABSQ AARCH64_BUILTIN_NANQ AARCH64_BUILTIN_NANSQ
So we can (if necessary) split these out and put them in sooner.
I guess looking at what aarch64-linux does for the long double case (I should check if it supports __float128 / _Float128, if so that ought to be even better as a guide). |
I had a build of aarch64-linux already ...
seems to generate:
Which, if I read it correctly, is horrible, losing all the precision of the float128 in the process.... edit: I suppose because __builtin_copysign is somehow defaulting to whereas....
So it seems we need to figure out what is done for the long double case. I'm wondering if there needs to be an optab entry for the "q" versions (and how that is arranged). |
ah but, if I do...
that is also accepted and produces the inline code without truncations. (but presumably it is not for Darwin's __float128) |
produces the right output, so maybe the solution is to alias __builtin_copysignq => __builtin_copysignf128 |
edit: it does not seem that the core builtins have "q" as one of the options. |
I have a further patch for fabsq():
but it fails to build because
so the TFmode variants are not exposed. I can see two places where that could come from in
or
(but I think the latter one is for |
yes, for the standard optabs to expand that, there has to be a match like:
in but, this does not seem to be necessary for things like copysign for f128 - the generic expansion code seems to work ..
also seems to work OK - so maybe it's a question of invoking that (figuring out what the spelling for the IFN_ is..) |
also: looking at the output of fdump-tree-gimple for
It seems that the front end already lowers the first three:
I did not look at how it matches those. |
Yes of course, I can fold fabsq(), it's much easier:
Pushed as a second commit. Only __builtin_copysignq() remains to be dealt with. |
I wonder if there's a way to fold the __builtin_copysignq => __builtin_copysignf128. There are a lot of builtin_xxxxf128, AFAICS from looking in gcc/builtins.cc .. I don't think we'd want to do all of them manually. |
Closing in favour of #122 |
Not ready for merging at this stage, first rough implementation. Will need tests.
abstf2
andcopysigntf3
patterns. I'm not sure how to do that, I think it needsemit_insn()
but I'm not entirely sure how to use that.