Releases: llvm-mos/llvm-mos-sdk
Releases · llvm-mos/llvm-mos-sdk
SDK v10.0.0
Breaking changes
- llvm-mos/llvm-mos@2550bb7 - Make
(u)int16_t
(unsigned) int
, not(unsigned) short
.- This has a very fine distinction with little to no runtime effect, but it now follows AVR, and it makes the e.g.
PRI16d
format specifier justd
rather thanhd
. Code is very unlikely to break, but it still seems possible.
- This has a very fine distinction with little to no runtime effect, but it now follows AVR, and it makes the e.g.
New features
- Implemented the all max-width functions in
<inttypes.h>
(except the wide character versions). - a1a8d22 - Implement the
strtox
family of instructions using PDCLib. - 546bf8b - Define
MB_CUR_MAX
from<stdlib.h>
in line with other clang targets. - eaf7bd5 - Implement
atox
family of functions using PDCLib. - 08494f6 - Implement
rand
andsrand
using a 16-bit xorshift.- The implementation is a tradeoff; it's relatively small and fast, and its statistical properties are good for each bit of the output, but it has a short period of 65536. The standard puts no requirements on period, and this is the smallest PRNG I could find with good quality output within its period. We could use a 16-bit add-only LCG, which may be smaller but has worse behavior, or a 32-bit xorshift, which would provide a non-permutation in the low 16 bits returned by
rand()
and a POSIX compliant 2^32 period, but it would be considerably slower and larger.
- The implementation is a tradeoff; it's relatively small and fast, and its statistical properties are good for each bit of the output, but it has a short period of 65536. The standard puts no requirements on period, and this is the smallest PRNG I could find with good quality output within its period. We could use a 16-bit add-only LCG, which may be smaller but has worse behavior, or a 32-bit xorshift, which would provide a non-permutation in the low 16 bits returned by
Bug fixes
- llvm-mos/llvm-mos@10e7734 - Define
__STDC_HOSTED__
to0
; we're not yet a hosted implementation. - 2f0c6cd - Define
__STDC_NO_COMPLEX__
to1
, since<complex.h>
is unavailable. - 885708d - Define
__STDC_NO_ATOMICS__
to1
, since atomics are not yet supported.
Miscellaneous
- Merge from llvm/llvm-project@5f71aa9
SDK v9.1.0
New targets
- #272 - Atari 8-bit MegaCart and SIC! cartridges (
atari8-mega
) - @cwedgwood - #279 - Atari 5200 "Super Cart" target (also supports single 32KiB bank) (
atari5200-super
) - @cwedgwood
New features
- 887ed60 - Implemented
assert.h
Optimizations
- llvm-mos/llvm-mos@3d56785 - Internalize libcalls and run dead code elimination
- This detects ultimately unused functions that were brought into the link in case late code generation needed them. This allows them to be stripped out before they consume valuable static stack or zero page space.
- As a result,
abort
and the floating point libcalls were moved into LTO with the others, allowing them to use the zero page and static stack.
Bug fixes
- llvm-mos/llvm-mos#385 - Added error messages for overlapping inline asm clobbers and input registers
- d0e7823 - Fixed SDK constraint issues uncovered by above
- #277 - Allowed NES GTROM to correctly emit PRG-ROMs smaller than the maximum - @cwedgwood
- cd715b3 - Added missing return value to
strcat
- b071f2e - Preserve NUL characters to repair video character set user-defined C++ literals
- #287 - Remove duplicate entries from VIC20 charset switches - @cwedgwood
Miscellaneous
- Merged from llvm/llvm-project@5f71aa9
SDK v9.0.1
Bug fixes
- #269 - Fixed an off-by-one error in the MMC3 8k banking linker script
- This produced invalid ROMs if PRG-ROM was set to less than the maximum size.
Optimizations
- llvm-mos/llvm-mos#426 - Made compiler default to
-ffunction-sections
and-fdata-sections
when LTO is disabled so that linker garbage collection can work while the libcalls are out of LTO.
Miscellaneous
- Merged from llvm/llvm-project@10f15e2
SDK v9.0.0
Breaking changes
- #258 - Rename
atari8
toatari8-dos
- @cwedgwood
Optimizations
- #259 - Move
atexit
tocxa-atexit.cc
- This prevents references to
stdlib.cc
functions (e.g., calloc) from bringing in the atexit runtime support unnecessarily.
- This prevents references to
Bug fixes
- Prevent NES GTROM mapper from using CHR-ROM
- The original implementation of this mapper always had 16KiB of CHR-RAM, and its mapper, 111, is shared with another Chinese fan translation project. Newer Mesen detect the fan translation by the presence of CHR-ROM, so it's not the case that CHR-ROM GTROM will work across widely-used emulators.
Miscellaneous
- Merged from upstream llvm/llvm-project@c43c86c
SDK v8.1.0
New targets
- #250 - Atari 8-bit XEGS (bank-switched) cartridge support - @cwedgwood
New features
- llvm-mos/llvm-mos#10 - Floating Point Support
- llvm-mos now supports the
float
anddouble
data types, with binary32 and binary64 IEEE 754 implementations, respectively. The soft float library comes from LLVM's compiler-rt, and it isn't very well optimized for the 6502. Printf support may be manually included by passing-lprintf_flt
. Unfortunatly, at present, printf must operate over doubles, and the simulator is the only target large enough to support a full printf implementation. Work is underway to make this smaller. - All relevant llvm-test-suite end-to-end floating-point tests pass.
- llvm-mos now supports the
Optimizations
- llvm-mos/llvm-mos#419 - Strict inlining costs
- The inliner no longer forces inlining to occur when an indirect call can be elided. This happened with printf, which could cause up to a complete printf implementations to be duplicated up to four times.
Bug fixes
- Ignore empty records in ABI: Empty unions could cause the compiler to crash.
Known issues
- The floating point libcalls are huge; this suggests they should be kept out of LTO, since ultimately unused libcalls present in LTO can still end up permanently bringing things in. Unfortunately, libcalls must be either fully included in LTO or fully excluded, since they are implicitly treated as
__attribute__((leaf))
. I opted for the latter, which means that this release regresses performance of large libcalls, since they can no longer use the zero page or static stacks. Work is underway to provide better stripping for unused libcalls, which will allow us to summarily pull in all libcalls to LTO in a future release.
Misc
SDK v8.0.1
Bug fixes
- llvm-mos/llvm-mos#413 - Fixed compiler crash due to new shift chaining optimization.
- Fixed latent issue in register scavenger; it would attempt to scavenge X, but this isn't implemented. Instead, disable ZP, Y addressing to avoid the case.
- Fixed recursive codegen issue uncovered in the register scavenger; since it can run more than once, we need to check if the reserved imaginary save registers are in use before marking a register for scavenging.
- #247 - Fix
pce_joypad_read()
only returning low nibble - @asiekierka
Optimizations
- #248 - Base printf routines on one another. Helps decrease code size when multiple printf variants are used.
Miscellaneous
- #246, llvm-mos/llvm-mos#412 - Add arm64 build target for macOS
- #241 -- Use emutest and libretro to test arbitrary emulators in Github CI (currently only NES and Atari2600 are implemented) - @sehugg
- Merge llvm/llvm-project@f4c6947
SDK v8.0.0
Breaking changes
- #242 - Rename cx16 kernal call
SAVEHL
toBSAVE
-- @XarkLabs- This call was not documented previously, and internal vector was called savehl (save headerless). Now it is documented as BSAVE so this PR renames kernel vector and function to match documentation.
New features
- #244 - Add missing
cbm_k_chkout
KERNAL routine.
Optimizations
- llvm-mos/llvm-mos#408 - Optimize multiplies and chain shifts
- Multiplies by constants are now relaxed into a add or subtract of two shifts, wherever possible.
- Shifts of the same base by different constant amounts in the same direction are now chained off of each other, with lesser amounts occuring "on the way" to greater amount. Code is moved globally within a function to form the chains.
- This also fixes llvm-mos/llvm-mos#268, where a manual add of shifts would be normalized into a multiply, but lacking this backend transform, the multiply would stay all the way to final output.
Bug fixes
- llvm-mos/llvm-mos#381 - Support relative and absolute paths in
-fpost-link-tool
. - llvm-mos/llvm-mos#403 - Don't report function sizes for Mesen label files
- Providing function symbol sizes corrupts the disassembly in Mesen's debugger
- #239 - Various Atari 2600 fixes -- @sehugg
- Fixed zp section overlapping registers.
- Fixed bank selection macros to accept macro parameters.
- Better Stella signature.
- Make
cbm.h
header work when included from C++.
SDK v7.1.0
New targets
Bug fixes
- llvm-mos/llvm-mos#354 - Added error messages for out-of-range relocations
- For compatibility with existing practice, the high two bytes of the 32-bit virtual addresses are ignored for 8-bit and 16-bit addresses.
SDK v7.0.1
Bug fixes
- llvm-mos/llvm-mos#379 - Fixed compiler crash due to branch folding
- llvm-mos/llvm-mos#399 - The compiler now conservatively sizes inline assembly when determining whether to a relative branch is in range.
- llvm-mos/llvm-mos#393 - Inline assembly now has callee-saved imaginary registers correctly rewritten to the zero page stack when appropriate.
SDK v7.0.0
Breaking changes
- llvm-mos/llvm-mos#397 -- Rename xo65 segment hex from
_XX
to_xXX
.- This avoids a conflict with the dollar sign escape
_d
.
- This avoids a conflict with the dollar sign escape
Bug fixes
- Fix latent data structure corruption in MOSTargetStreamer
- llvm-mos/llvm-mos#398 -- Fix xo65 integration on Windows