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

Support for non-x86-64 SBCL #427

Open
Partmedia opened this issue Dec 8, 2023 · 1 comment
Open

Support for non-x86-64 SBCL #427

Partmedia opened this issue Dec 8, 2023 · 1 comment

Comments

@Partmedia
Copy link

Because I happen to want to run a grpc server written in Common Lisp on GNU/Linux aarch64 (arm64), I'm interested in what it would take to upstream support for this. Most notably, aarch64 is (by default) big endian.

Based on some cursory looking, it looks like only define-fixed-width-encoder needs to be implemented?

For implementing this, would it be acceptable to bring in a whole or parts of a library like swap-bytes? This particular library is available under the MIT license. The strategy could be then to:

  • Add htonl/htonq equivalents that convert integers to protobuf wire format (little endian)
  • Wrap fixed with integer accessors (e.g. sb-sys:sap-ref-N) to a call to those equivalents

On little-endian machines the conversion functions would become no-ops, and on big-endian machines it would call the internal swap-bytes implementation.

This library currently does not implement a native byte-swap routine for arm64 and would resort to a portable fallback, but a faster implementation using arm64 intrinsics could be upstreamed.

@mdbergmann
Copy link

Not sure. But it works here on aarch64 on Mac.
Is this different from aarch64 Linux?

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

No branches or pull requests

2 participants