Skip to content

Conversation

@c-a
Copy link
Contributor

@c-a c-a commented Jan 1, 2014

This patchset adds intrinsics similar to the to_[be|le][16|32|64] intrinsics but for going in the reverse direction, e.g. from big/little endian to host endian. Implementation wise they do exactly the same as the corresponding to_* functions but I think it anyway make sense to have them since using the to_* functions in the reverse direction is not entirely intuitive.

The first patch adds the intrinsics and the two following changes instances of bswap* to use the [to|from]_* intrinsics instead.

c-a added 3 commits January 1, 2014 22:27
These are similar to the ntoh[s|l] functions in C and have the style of
from_[be|le][16|32|64].
Also use the fast version of vuint_at() on all architectures since it now
works on both big and little endian architectures.
@alexcrichton
Copy link
Member

I like having these (as you can see from the code in libnative). I'm not convinced these should go inside unstable::intrinsics, but all of the to_XX functions are in there, so for now I think it's ok.

If we find a better place for these functions, they can all be moved at once.

bors added a commit that referenced this pull request Jan 2, 2014
This patchset adds intrinsics similar to the to_[be|le][16|32|64] intrinsics but for going in the reverse direction, e.g. from big/little endian to host endian. Implementation wise they do exactly the same as the corresponding to_* functions but I think it anyway make sense to have them since using the to_* functions in the reverse direction is not entirely intuitive.

The first patch adds the intrinsics and the two following changes instances of bswap* to use the [to|from]_* intrinsics instead.
@bors bors closed this Jan 2, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2023
…es, r=llogiq

Don't escape unicode escape braces in `print_literal`

Fixes rust-lang#11264

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants