This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support signbit, signbitf and signbitl as GCC builtins (take2)


Roger Sayle wrote:

>        * builtins.c (expand_builtin_signbit): New function to RTL expand
>        calls to signbit, signbitf and signbitl as inline intrinsics.

This appears to be broken on s390x (64-bit big endian target).  The new
builtins-32.c test case fails because it tests the high-order bit of
the *low* order SImode half of the DFmode value, instead of the high-order
bit of the high-order half.

This is caused by an -in my understanding- invalid use of gen_highpart.
That routine works correctly only if the high part will after reload
reside within one register of a multi-word value, but not if the value
will occupy the upper half of single-word value.

You generate a (subreg:SI (reg:DF ...) 0), which violates this constraint
on 64-bit big endian targets; when confronted with this subreg, reload 
silently generates incorrect code.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]