Releases: llvm-mos/llvm-mos-sdk
Releases · llvm-mos/llvm-mos-sdk
SDK v15.3.0
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 andfopen
in the same project, the link will fail.
- There's not actually much you can do with open files, and if you try to use most
fclose
(with automaticfclose
on exit)rename
tmpfile
tmpnam
SDK v15.2.0
New features
Bug fixes
- llvm-mos/llvm-mos@d689274 - Fix ld65 "invalid argument" error on Windows when LLD does multiple passes (ca65 integration)
SDK v15.1.0
New targets
- #329 - Initial Atari Lynx support (
.bll.o
) -mos-lynx-bll-clang
- @asiekierka
SDK v15.0.0
Breaking changes
- llvm-mos/llvm-mos#456 - 65816 assembler changes - @asiekierka
lda >addr
was previously interpreted aslda mos16hi(addr)
, but now will be interpreted aslda mos24(addr)
. This is unlikely to break production code.lda <addr8
was previously interpreted aslda mos16lo(addr)
, but now will be interpreted aslda 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, whilelda !addr
andlda #^addr
have been introduced.
Immediate expressions now emitR_MOS_IMM8
andR_MOS_IMM16
, while address expressions now emitR_MOS_ADDR8
andR_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
andaddr + Y
addressing mode syntaxes have been fixed, and a test has been added. S
andR
can now be used as register names in stack-relative addressing modes instead ofSP
andRP
. This matches WDC 65816 and 65EL02 documentation/recommendations, respectively.
- The immediate and address modifiers (
-
dc85a7d - Fix
is_floating_pointr_v
C++<type_traits>
typo
SDK v14.2.0
New targets
- #324 - Port to the Watara Supervision (
mos-supervision-clang
) - @asiekierka
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 ofM
andX
flags required to disassemble a given opcode, allowing tools likellvm-objdump
to distinguish betweenlda #$ea
andlda #$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.
- Add support for forcing "long" addressing mode with
Optimizations
- llvm-mos/llvm-mos#452 - Correct register allocation cost values for 65CE02 - @asiekierka
- llvm-mos/llvm-mos#453 - Avoid commuting operands when doing so would lead to fewer trivial copies - @asiekierka
SDK v14.1.0
New features
- llvm-mos/llvm-mos#449 - 65CE02 - Add assembler support for relaxing long branches - @asiekierka
- llvm-mos/llvm-mos#448 - SPC700 - Emit MOV imag8, immediate instructions - @asiekierka
Bug fixes
- #321 - Disable ZP LTO on CP/M-65 to work around #320 - @davidgiven
Misc
- #319 - Print help text for simulator MMIO interface - @asiekierka
SDK v14.0.0
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.
- The spirit and letter of the C standard state that the effects of
- 7714ed4 - Translate
\b
toCURSOR LEFT
on Commodore- Backspace is specified to move the cursor to the previous position on
the current line, and that's precisely whatCURSOR LEFT
performs.
- Backspace is specified to move the cursor to the previous position on
- 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
, andcx16
now have analogous mappings forgetchar
andputchar
.
- 069e059 -
errno
values now follow Linux.
New features
- All remaining
<stdio.h>
functions have been implemented. They only support the filesstdin
,stdout
andstderr
, 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.
- The
Bug fixes
- #314 - Fix
realloc
returning memory regions that overlap with previous allocations
SDK v13.0.0
Breaking changes
- f99cf88 -
printf
%p
now prints as if%#x
, not%X
(i.e.,0xabcd
, notABCD
).
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
- Before
- Simulator
printf("Hello %f\n", 6502.0)
- Before
- Size: 40482
- Cycles: 41425
- After
- Size: 9772
- Cycles: 219893
- Before
- Simulator
Bug fixes
- #306 - Make
__heap_start
relocatable, fixing heap on CP/M-65 - @davidgiven - f99cf88
printf
floating point printing is now correctly roundedprintf
now displays the full integral part of%f
instead of bailing and using%e
SDK v12.0.0
Breaking changes
- llvm-mos/llvm-mos@9a4523b -- Make all types prefer
int
toshort
- This follows AVR, and it make int promotions work more like expected.
size_t
is nowunsigned int
, wasunsigned short
ptrdiff_t
is nowsigned int
, wassigned short
intptr_t
is nowsigned int
, wassigned short
char16_t
is nowunsigned int
, wasunsigned short
wint_t
is nowsigned long
, wasunsigned long
(now accomodates a -1
WEOF
)
- This follows AVR, and it make int promotions work more like expected.
- 1475f49 -- Targets should now implement the default
SIGABRT
handler__sigabrt()
instead ofabort()
.abort()
now invokesraise()
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
.
- 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
- 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 nowatari5200-supercart
(Super Cart cartridge)atari8-stdcart
is nowatari8-cart-std
(Standard cartridge)atari8-xegs
is nowatari8-cart-xegs
(XEGS catridge)atari-mega
is nowatari8-cart-megacart
(Megacart cartridge)
New features
- llvm-mos/llvm-mos#442 - Lower
fptoui.sat
andfptosi.sat
saturating float to integer intrinsics- Lowers them to
fmax
andfmin
, which aren't yet implemented. Still, the compiler no longer crashes.
- Lowers them to
- 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>
(addstrcspn
andstrstr
). - #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
thenBR
with a new family ofCmpBr
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__
fromatari.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 usesRTS
trick - @cwedgwood - #297 -- Use
HATABS
for Atari__putchar
- @cwedgwood - #305 -- Add C++
extern "C"
to<rp6502.h>
- @rumbledethumps - #295 -- Remove
va_start
warning from RP6502xregn
- @rumbledethumps
SDK v11.0.0
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.
- This function comes from POSIX, and it's properly part of
New targets
- #293 -- Picocomputer 6502 (RP6502) --
mos-rp6502-clang
-- @rumbledethumps
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 ;)
- This is a version of
- ac77ee4 - Implement the
quick_exit
familyquick_exit
allows exiting from the program without running C++ destructors, but while still doing other process-related cleanup. (Once we have astdio
, this will typically mean flushing and closing open files.) It also adds anat_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 permalloc
. The cost is a modestly increased code size and that heap objects are now two-byte aligned.
- This makes our implementation of
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.