Skip to content

Releases: llvm-mos/llvm-mos-sdk

SDK v15.3.0

25 Apr 22:05
Compare
Choose a tag to compare

New library features

  • All of the below only support the c64. Picked this arbitrarily; other backends will come later.
  • fopen
    • There's not actually much you can do with open files, and if you try to use most stdio functions and fopen in the same project, the link will fail.
  • fclose (with automatic fclose on exit)
  • rename
  • tmpfile
  • tmpnam

SDK v15.2.0

09 Apr 16:13
b61b298
Compare
Choose a tag to compare

New features

  • #154 - Add MEGA65 headers for hardware registers - @mlund

Bug fixes

SDK v15.1.0

04 Apr 16:01
becc1c3
Compare
Choose a tag to compare

New targets

  • #329 - Initial Atari Lynx support (.bll.o) - mos-lynx-bll-clang - @asiekierka

SDK v15.0.0

27 Mar 17:27
47b35b2
Compare
Choose a tag to compare

Breaking changes

  • llvm-mos/llvm-mos#456 - 65816 assembler changes - @asiekierka
    • lda >addr was previously interpreted as lda mos16hi(addr), but now will be interpreted as lda mos24(addr). This is unlikely to break production code.
    • lda <addr8 was previously interpreted as lda mos16lo(addr), but now will be interpreted as lda mos8(addr). As the two relocations are functionally (but not semantically) equivalent, this should not break production code.
    • Likewise, functional (but not semantic) changes involve the relocations emitted by immediate expressions (lda #val).

New features

  • #316 - Add C++ fixed point math library - @jroweboy
    • Supports various fractional and integral bit sizes.
    • Supports user-defined literals for common sizes (e.g., 9.4_12_4 is the 16-bit fixed point number with 12 integral bits and 8 fractional bits that is closest in value to 9.4).

Bug fixes

  • llvm-mos/llvm-mos#456 - 65816 assembler changes - @asiekierka

    • The immediate and address modifiers (#<, #>, #^, <, !, >) now adhere to WDC recommendations as documented in the 65816 datasheet.
    • In particular, this means the behaviour of lda >addr changes, while lda !addr and lda #^addr have been introduced.
      Immediate expressions now emit R_MOS_IMM8 and R_MOS_IMM16, while address expressions now emit R_MOS_ADDR8 and R_MOS_ADDR16 relocations.
    • Some error messages have been adjusted to more accurately represent the assembler's limitations.
    • Bugs/limitations in the SPC700 assembler's handling of addr + X and addr + Y addressing mode syntaxes have been fixed, and a test has been added.
    • S and R can now be used as register names in stack-relative addressing modes instead of SP and RP. This matches WDC 65816 and 65EL02 documentation/recommendations, respectively.
  • dc85a7d - Fix is_floating_pointr_v C++ <type_traits> typo

SDK v14.2.0

12 Mar 16:24
6c4e175
Compare
Choose a tag to compare

New targets

New features

  • llvm-mos/llvm-mos#355 - 65816 assembler improvements - @asiekierka
    • Add support for forcing "long" addressing mode with lda mos24(addr).
    • Finish support for $ml, $mh, $xl, $xh mapping symbols. These mark the state of M and X flags required to disassemble a given opcode, allowing tools like llvm-objdump to distinguish between lda #$ea and lda #$eaea. This information is gathered from the instruction itself - .a8/.a16/.i8/.i16 or whatever we end up implementing to set the default instruction encoding can then simply affect which instruction is selected in the parsing process. Tests have been provided to match other architectures with mapping symbols.
    • Add missing BIT #$eaea opcode to 65816.

Optimizations

SDK v14.1.0

05 Mar 04:07
Compare
Choose a tag to compare

New features

Bug fixes

Misc

SDK v14.0.0

27 Feb 04:43
Compare
Choose a tag to compare

Breaking changes

  • 8a21f34 - Swtich to ISO mode for Commander X16
    • The spirit and letter of the C standard state that the effects of
      printing printable characters in the execution character set (ASCII)
      should produce the corresponding character on the display. Since the
      Commander X16 has full ASCII support, we need to switch to ISO mode if a
      character could ever be output to the screen. This is similar to the
      shifted PETSCII switch now done for other Commodore family targets.
  • 7714ed4 - Translate \b to CURSOR LEFT on Commodore
    • Backspace is specified to move the cursor to the previous position on
      the current line, and that's precisely what CURSOR LEFT performs.
  • 8f468fc - Rename __char_conv to __from_ascii.
  • 90c3977 - Split getchar into __getchar and __to_ascii.
  • getchar is now a library function, and the target-specific hooks are __getchar to get a target character, and __to_ascii to convert a sequence of target characters into an ASCII character.
  • 90c3977 - Correct target to ASCII mappings for getchar
    • atari8, commodore, and cx16 now have analogous mappings for getchar and putchar.
  • 069e059 - errno values now follow Linux.

New features

  • All remaining <stdio.h> functions have been implemented. They only support the files stdin, stdout and stderr, and there's presently no way to redirect them or open other files. This implementation I'm calling the "trivial" <stdio.h>; we'll also have a "full" implementation that gets linked in if a file might possibly be opened or redirected.
    • The scanf doesn't yet support floating point numbers.

Bug fixes

  • #314 - Fix realloc returning memory regions that overlap with previous allocations

SDK v13.0.0

19 Feb 23:48
Compare
Choose a tag to compare

Breaking changes

  • f99cf88 - printf %p now prints as if %#x, not %X (i.e., 0xabcd, not ABCD).

New features

  • #303 - Add fmin/fmax functions to <math.h> - @mlund
  • f99cf88 - printf now supports %a to print floating point numbers in hexadecimal

New examples

Optimizations

  • f99cf88 - Rewrite printf using PDCLib
    • Simulator printf("Hello %d\n", 6502)
      • Before
        • Size: 6520
        • Cycles: 8865
      • After
        • Size: 4185
        • Cycles: 6084
    • Simulator printf("Hello %f\n", 6502.0)
      • Before
        • Size: 40482
        • Cycles: 41425
      • After
        • Size: 9772
        • Cycles: 219893

Bug fixes

  • #306 - Make __heap_start relocatable, fixing heap on CP/M-65 - @davidgiven
  • f99cf88
    • printf floating point printing is now correctly rounded
    • printf now displays the full integral part of %f instead of bailing and using %e

SDK v12.0.0

13 Feb 03:54
3729744
Compare
Choose a tag to compare

Breaking changes

  • llvm-mos/llvm-mos@9a4523b -- Make all types prefer int to short
    • This follows AVR, and it make int promotions work more like expected.
      • size_t is now unsigned int, was unsigned short
      • ptrdiff_t is now signed int, was signed short
      • intptr_t is now signed int, was signed short
      • char16_t is now unsigned int, was unsigned short
      • wint_t is now signed long, was unsigned long (now accomodates a -1
        WEOF)
  • 1475f49 -- Targets should now implement the default SIGABRT handler __sigabrt() instead of abort(). abort() now invokes raise() as required by the standard.
  • ea8aea8 - Break character conversion out of __putchar into __char_conv
    • __putchar now simply outputs to the target equivalent of file descriptor
      zero; it no longer converts to the target character set. Accordingly, __putchar now replaces __chrout on most targets; __chrout has been removed. Character conversion functionality has been moved to a new __char_conv.
  • 72e3379 -- Translate to shifted PETSCII at runtime; shift on startup if translation used.
    • This is likely to be a bit controversal; see the commit message for a detailed rationale. The jist is that the language of the standard essentially requires that outputting characters in our execution character set (ASCII) to the screen display their normal representation, as far as is possible. For the C64, that means shifting the character set. Accordingly, we do this in a constructor tied to the inclusion of __char_conv.
  • 597971d -- Translate to ATASCII control codes
  • Similar to the above, but probably less controversal. ASCII '\t', '\a', and '\b' are now translated at runtime to their ATASCII equivalents.
  • #300 - Normalize Atari cartridge target naming - @cwedgwood
    • atari5200-super is now atari5200-supercart (Super Cart cartridge)
    • atari8-stdcart is now atari8-cart-std (Standard cartridge)
    • atari8-xegs is now atari8-cart-xegs (XEGS catridge)
    • atari-mega is now atari8-cart-megacart (Megacart cartridge)

New features

  • llvm-mos/llvm-mos#442 - Lower fptoui.sat and fptosi.sat saturating float to integer intrinsics
    • Lowers them to fmax and fmin, which aren't yet implemented. Still, the compiler no longer crashes.
  • 8d67b8d -- Add a stub for getenv
  • 81161eb -- Add a stub for 'system'
  • 1475f49 -- Add a minimal <signal.h>
  • c0f1c7a -- Add qsort
  • 2f99463 -- Add bsearch
  • 543b5a9 -- Finish <string.h> (add strcspn and strstr).
  • #294 - Add all remaining RP6502 OS calls -- @rumbledethumps

Bug fixes

  • llvm-mos/llvm-mos@981c2b6 -- Correct handling of aliases to globals allocated to zero page
  • llvm-mos/llvm-mos#422 -- Replace CMPTerm then BR with a new family of CmpBr pseudo-instructions
    • This fixes a longstanding ugly fragility in the backend, but it required rewriting quite a few routines.
  • 90f616f -- Fix xregn varargs UB in RP6502 target
  • c49a529 -- Remove incorrectly coped .ifdef __ATARIXL__ from atari.inc
  • 3e94be4 -- Nonstandard strtox were prefixed with an underscore
  • 543b5a9 -- strrev in <string.h> has been renamed to _strrev to match Microsoft's current recommendations, and since it's not a standard function.
  • #296 -- Don't allow inline of Atari __putchar, since it uses RTS trick - @cwedgwood
  • #297 -- Use HATABS for Atari __putchar - @cwedgwood
  • #305 -- Add C++ extern "C" to <rp6502.h> - @rumbledethumps
  • #295 -- Remove va_start warning from RP6502 xregn - @rumbledethumps

SDK v11.0.0

29 Jan 18:29
621228d
Compare
Choose a tag to compare

Breaking changes

  • d231325 - Remove _exit
    • This function comes from POSIX, and it's properly part of <unistd.h>, which we don't have, not <stdlib.h>. Accordingly, it was suspect for us ever to have included it, especially since the standard has an equivalent in <stdlib.h>, _Exit. Accordingly, all uses of _exit in the SDK have been rewritten to use _Exit, and this should be the mechanism defined by new targets going forward.

New targets

New library features

  • #292 -- Implement aligned_alloc.
    • This is a version of malloc that supports a power of two alignment specification. This can be useful when sizes of allocated objects are naturally powers of two, since it allows stashing data in the low bits of pointers to the objects. Plus it's in the C standard ;)
  • ac77ee4 - Implement the quick_exit family
    • quick_exit allows exiting from the program without running C++ destructors, but while still doing other process-related cleanup. (Once we have a stdio, this will typically mean flushing and closing open files.) It also adds an at_quick_exit to allow registering callbacks to occur on quick exit (atexit handlers do not).

Optimizations

  • #292 - Rewrite malloc
    • This makes our implementation of malloc a standard Knuth boundary tag allocator that allocates in first fit FIFO order. This removes all O(n) operations that except the single first-fit freelist scan; accordingly, free is now constant time instead of O(n). It also removes all heap space overhead except the two byte header per malloc. The cost is a modestly increased code size and that heap objects are now two-byte aligned.

Bug fixes

  • #289 -- NES GTROM -- Declare write_ppu to return void -- @cwedgwood
  • e61baad - calloc now correctly detects integer overflow in its multiplication and returns NULL, rather than producing undefined behavior.