3 ms·
Most of the embedded world has 8-bit bytes, not just ARM. Even when it comes to XAP2, there's the newer XAP2b which apparently supports byte addressing [1]. B
by comex 8y ago
Most of the embedded world has 8-bit bytes, not just ARM. Even when it comes to XAP2, there's the newer XAP2b which apparently supports byte addressing [1].
But if you do want larger bytes… well, the first step would be getting LLVM to support them. According to this blog post from last year, it's theoretically possible but would need work:
https://www.embecosm.com/2017/04/18/non-8-bit-char-support-in-clang-and-llvm/ https://www.embecosm.com/2017/04/18/non-8-bit-char-support-i...
And of course, you'd need an LLVM backend for the architecture in question.
Only then would the ball be in the court of rustc itself. At that point, I still wouldn't expect non-8-bit byte support be a priority for the core developers, but I expect patches would be welcome. Though if the LLVM backend includes support for emulating u8 and u8 pointers where necessary, relatively little change would be needed from rustc anyway.
[1] "The XAP2b adds data-side byte addressing support to the XAP2 by utilizing the 15th bit of the data-side address bus to indicate byte or word accesses." http://static6.arrow.com/aropdfconversion/ef173143abb7413e6981d32e4d994087aed76942/333em250.pdf http://static6.arrow.com/aropdfconversion/ef173143abb7413e69...
- btashton 8y agoMy comment was more just trying to address this statement. >A lot of the things C was trying to cope with have largely died off or been relegated to incredibly niche platforms. This particular property of C is not uncommon in the embedded space. Especially since the XAP2 is by far the most used in the XAP family and is right behind ARM in volume. That said I don't know how much it is still being used by Qualcomm as I know they are now using more Xtensa cores alongside ARM. Xtensa is another major architecture sitting as small co processors in various silicon designs that is not well known, but is highly flexible. LLVM does not support even the cor versions of it. I know the Espressif team is looking to bring some support for it in.