|
|
Log in / Subscribe / Register

Would you like signs with those chars?

Would you like signs with those chars?

Posted Oct 25, 2022 4:16 UTC (Tue) by scientes (guest, #83068)
Parent article: Would you like signs with those chars?

> On Arm systems, though, char variables are unsigned (unless explicitly declared signed) instead.

I want to point out that the LDRB and LDRBT instructions also zero-extend byte loads, so this unsignedness is part of the ABI.


to post comments

Would you like signs with those chars?

Posted Oct 26, 2022 15:42 UTC (Wed) by jrtc27 (subscriber, #107748) [Link]

LDRx for B/H(/W on AArch64) zero-extends in general, yet short and int are still signed. Plus if you put an S after the R you get the sign-extending version of the instruction (which even exists for the LDRxT (AArch32) / LDTRx (AArch64) unprivileged loads). Thus nothing about the ABI is forced, or even made more efficient if a particular choice is made, by the instruction set here, just whether the mnemonics have an S in them or not.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds