This is an archive of the discontinued LLVM Phabricator instance.

Support: xxHash64: Zero extend byte values loaded from the input data.
AbandonedPublic

Authored by pcc on Jul 27 2018, 11:14 AM.

Details

Reviewers
ruiu
Summary

This matches the reference implementation:
https://github.com/Cyan4973/xxHash/blob/3064d42e7d74b0921bdd1818395d9cb37bb8976a/xxhash.c#L707
https://github.com/Cyan4973/xxHash/blob/3064d42e7d74b0921bdd1818395d9cb37bb8976a/xxhash.c#L147

and makes the behaviour independent of whether we are compiled with
-funsigned-char.

Diff Detail

Event Timeline

pcc created this revision.Jul 27 2018, 11:14 AM
ruiu added a comment.Jul 27 2018, 11:25 AM

Hmm, P is a pointer to a unsigned char, so it is always sign-extended, no? What am I missing?

ruiu accepted this revision.Jul 27 2018, 11:31 AM

In your diff (it's hidden but you can reveal it by clicking show all liens), it was an unsigned char. Anyways, LGTM.

This revision is now accepted and ready to land.Jul 27 2018, 11:31 AM
pcc abandoned this revision.Jul 27 2018, 11:53 AM
pcc added a subscriber: MaskRay.

Oh, it looks like @MaskRay fixed this in a different way in rL338128.

In D49923#1178580, @pcc wrote:

Oh, it looks like @MaskRay fixed this in a different way in rL338128.

I conveyed the message to you in a covert channel :)