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] Fix PR61306: improve handling of sign and cast in bswap


> From: Richard Biener [mailto:richard.guenther@gmail.com]
> 
> Err, but if you zero-extend directly to the target type you have the
> correct result, too.

Yep but in some case we need sign extend (32 bit bitwise OR stored
into 64 bit result). As I said, the logic could be simplified by sign
extending if load_size == bitwise expression size and zero extending
if not true. I'll rework the patch in this direction.

> 
> But nothing for the testsuite?  The testcase you add fails foul of
> sign-extending the loads.

Ack, I'll add a test for zero extension and one for sign extension.

Cheers,

Thomas




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