Skip to content

Releases: llvm-mos/llvm-mos-sdk

SDK v10.0.0

17 Jan 00:05
Compare
Choose a tag to compare

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 just d rather than hd. Code is very unlikely to break, but it still seems possible.

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 and srand 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.

Bug fixes

  • llvm-mos/llvm-mos@10e7734 - Define __STDC_HOSTED__ to 0; we're not yet a hosted implementation.
  • 2f0c6cd - Define __STDC_NO_COMPLEX__ to 1, since <complex.h> is unavailable.
  • 885708d - Define __STDC_NO_ATOMICS__ to 1, since atomics are not yet supported.

Miscellaneous

SDK v9.1.0

09 Jan 21:02
Compare
Choose a tag to compare

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

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

SDK v9.0.1

19 Dec 18:58
Compare
Choose a tag to compare

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

SDK v9.0.0

11 Dec 19:38
Compare
Choose a tag to compare

Breaking changes

Optimizations

  • #259 - Move atexit to cxa-atexit.cc
    • This prevents references to stdlib.cc functions (e.g., calloc) from bringing in the atexit runtime support unnecessarily.

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

SDK v8.1.0

04 Dec 19:04
Compare
Choose a tag to compare

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 and double 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.

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

28 Nov 00:59
cd3055e
Compare
Choose a tag to compare

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

SDK v8.0.0

18 Nov 20:57
7d4df2b
Compare
Choose a tag to compare

Breaking changes

  • #242 - Rename cx16 kernal call SAVEHL to BSAVE -- @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

12 Nov 21:40
d9b3373
Compare
Choose a tag to compare

New targets

  • #237 - Atari 2600 support (4K and 3E mappers) with VCSLib port - @sehugg

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

06 Nov 02:43
4c6e9a5
Compare
Choose a tag to compare

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

02 Nov 16:36
4c6e9a5
Compare
Choose a tag to compare

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.

Bug fixes

  • Fix latent data structure corruption in MOSTargetStreamer
  • llvm-mos/llvm-mos#398 -- Fix xo65 integration on Windows