-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Printing unsigned 64-bit integers (#492)
Ints in abra are 64-bit signed values, but it's also useful to treat those 64 bits as an unsigned value. There's currently no `UInt` type, because that would require a lot more logic with arithmetic and casting and dealing with overflows, but as a temporary stopgap, this introduces the `Int#unsignedToString` method (which uses `"%llu"` under the hood as the print formatter). This also updates the existing `Int#toString` implementation to use `"%lld"` (it had previously been using `"%d"`...). This also adds the `-fcall-saved-x18` flag to the flags passed to `clang` when compiling the assembly output of qbe. This is the clang version of the [`-ffixed-x18`](https://developer.arm.com/documentation/101754/0623/armclang-Reference/armclang-Command-line-Options/-ffixed-x18) flag from the arm compiler, which ensures that `x18` is preserved. Without this flag, this register can potentially be overwritten by the platform (in this case, macos) even though qbe treats it as a general-purpose register. This was the source of an extremely mysterious and frustrating bug.
- Loading branch information
Showing
5 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters