Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove __builtin_bswap16 call #4290

Merged
merged 2 commits into from
Dec 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ inline static int snprintf(char *buffer, size_t n, const char *format, ...) {
#endif
#endif

#if defined(__x86_64__)
# define BITS_PER_LONG 64
#else
# define BITS_PER_LONG 32
#endif

#ifndef ARRAY_SIZE
# define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
#endif
Expand Down
9 changes: 1 addition & 8 deletions src/util-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,8 @@ TypeName* Unwrap(v8::Local<v8::Object> object) {
}

void SwapBytes(uint16_t* dst, const uint16_t* src, size_t buflen) {
for (size_t i = 0; i < buflen; i++) {
// __builtin_bswap16 generates more efficient code with
// g++ 4.8 on PowerPC and other big-endian archs
#ifdef __GNUC__
dst[i] = __builtin_bswap16(src[i]);
#else
for (size_t i = 0; i < buflen; i += 1)
dst[i] = (src[i] << 8) | (src[i] >> 8);
#endif
}
}


Expand Down