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: PR target/42542: Vectorizer produces incorrect results on max of signed intergers


I see no other way to fixup the underflow. Some comments below:

You can always subtract (or XOR) the sign bit to turn an unsigned value to the corresponding signed value. The attached patch (on top of the code before H.J.'s patch) fixes the C testcase in the PR, but I didn't test it further and I don't have time unfortunately.


BTW, ia64_expand_vecint_compare is also similarly wrong, but the same trick would work there too.

Paolo

Attachment: pr42542-mine.patch
Description: Text document


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