Bob Andrews
4dfbccfafd
Merge pull request #2522 from kugelfuhr/kugelfuhr/code-optimizations
...
Improve generated code for AND/EOR/ORA
2024-10-05 15:03:46 +02:00
Bob Andrews
270aa4417b
Merge pull request #2524 from kugelfuhr/kugelfuhr/fix-2523
...
Fix some issues with preprocessor expressions
2024-10-05 14:14:29 +02:00
Kugel Fuhr
9c69aac097
Fix some issues with signedness in preprocessor expressions. Do also disallow
...
comma expressions since the aren't compliant and collide with macro invocations.
2024-09-17 11:45:46 +02:00
Kugel Fuhr
175ec65af1
Fix #2520 .
2024-09-14 21:12:19 +02:00
Kugel Fuhr
231ab4169b
Added a test.
2024-09-13 19:30:38 +02:00
Bob Andrews
34d8c3ef0a
Merge pull request #2517 from kugelfuhr/kugelfuhr/time-improvements
...
Improved/fixed the time() function
2024-09-13 17:47:14 +02:00
Bob Andrews
b5135b3ae0
Merge pull request #2502 from kugelfuhr/kugelfuhr/fix-2461
...
Fix issue #2461
2024-09-13 15:53:49 +02:00
Kugel Fuhr
efa2020d93
Improved/fixed the time() function:
...
- When the underlying clock_gettime function returned an error, the value
returned via *timep was wrong.
- Reduced code size by 7 bytes.
- Don't suck in ldeaxi.
2024-09-12 09:14:57 +02:00
Bob Andrews
31a0d5cc40
Merge pull request #2503 from colinleroy/master
...
Optimize stpcpy's size and speed
2024-09-08 16:17:14 +02:00
Colin Leroy-Mira
55d3a6ea39
Optimize stpcpy's size and speed
2024-09-07 21:24:53 +02:00
Kugel Fuhr
d996e20c5f
Fix issues #2461 . This was always wrong even in cases where it seemed to work.
...
If it did, it was by coincidence.
2024-09-03 20:21:48 +02:00
Kugel Fuhr
cd4357057f
The change from #2495 didn't take into account that recursive calls to main()
...
are legal in C. With the changes from #2495 , such calls will usually crash the
machine. But recursive calls to main() are rare and on the 6502 every byte
saved is precious. So this change limits the effect of #2495 to cc65 mode and
at the same time disallows recursive calls to main() in this mode. If
recursive calls to main() are actually required, the code must be compiled in
c89 or c99 mode.
2024-09-02 10:39:42 +02:00
Bob Andrews
601deab3a2
Merge pull request #2492 from kugelfuhr/kugelfuhr/alternative-pragma-names
...
Allow alternative names for pragmas that contain underlines instead of dashes
2024-09-01 17:57:38 +02:00
Kugel Fuhr
b4aef6eac4
Fix macro preprocessing for #include. Arguments enclosed in "" or <> must not
...
be preprocessed. See ISO/IEC 9899 1990 (E) section 6.8.2.
2024-09-01 13:16:35 +02:00
Kugel Fuhr
e40058257e
Added a test for the available #pragmas.
2024-09-01 10:23:29 +02:00
Bob Andrews
03d824e13b
Merge pull request #2464 from SvenMichaelKlose/stpcpy
...
Add stpcpy().
2024-07-16 01:47:11 +02:00
Sven Michael Klose
677cd8ff4e
Use standard library's exit() code constants.
2024-07-15 17:54:43 +02:00
Sven Michael Klose
9558ebad62
Add test for stpcpy().
2024-07-15 17:35:28 +02:00
Sven Michael Klose
816bcabe5a
Move strtok() test to correct section.
2024-07-14 23:12:59 +02:00
Colin Leroy-Mira
82165c1a77
Implement strcasestr
2024-03-18 19:51:50 +01:00
Bob Andrews
eb503cc542
Merge pull request #2390 from colinleroy/implement-shifts-by-7
...
Implement aslax7/shlax7/asrax7/shrax7
2024-02-02 20:17:48 +01:00
Bob Andrews
54b423a99e
fix test
2024-02-02 13:13:57 +01:00
acqn
96d55e3703
Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated.
2024-02-02 19:00:33 +08:00
Colin Leroy-Mira
ce606bb19e
Fix tests...
2024-01-31 08:40:36 +01:00
Colin Leroy-Mira
7d7cf2d1e0
Implement aslax7/shlax7/asrax7/shrax7
2024-01-29 07:59:11 +01:00
Colin Leroy-Mira
0dd7b0c3a5
Implement __sysremove for sim65
...
This will allow using unlink()/remove() in sim65 programs
Use it to unlink fgets' test output file
2024-01-28 13:58:57 +01:00
Bob Andrews
ee3a542539
Merge pull request #2383 from colinleroy/pmemalign-size-opt
...
Optimize -36 bytes out of posix_memalign
2024-01-24 21:26:50 +01:00
Colin Leroy-Mira
b87df9e1c6
Optimize -36 bytes out of posix_memalign
...
And add a unit test
2024-01-24 10:23:53 +01:00
Colin Leroy-Mira
3e01ac9b04
Fix malloc and realloc overflow
...
If user requests a size >= 65532, adding the heap admin size
overflows size. Fixes #2358 .
2024-01-24 09:54:54 +01:00
Bob Andrews
57e65a6bf6
Merge pull request #2348 from colinleroy/time-functions-pass-2
...
Convert more time functions to asm
2024-01-23 23:45:10 +01:00
Colin Leroy-Mira
01ee903cdf
Fixup gmtime/localtime/mktime tests with all cases
2024-01-22 16:38:39 +01:00
Colin Leroy-Mira
03d5e5fba0
Rewrite mktime in assembly
...
-415 bytes,
-39% cycles,
Unit test expanded to cover more cases (there was a bug in 2100 before!)
2024-01-18 09:09:38 +01:00
acqn
0b06c34dfc
Added primitive support for the ISO C99 inline feature as well as the __inline__ extension.
...
No inlining is actually done but that part is not required by the standard.
2024-01-14 00:08:41 +08:00
Colin Leroy-Mira
0c53e7e0da
Add test case for bug #2357
2024-01-16 20:55:48 +01:00
acqn
2682fc0b79
Fixed regression on comparison to null pointer.
2024-01-10 04:51:20 +08:00
Bob Andrews
2127778239
Merge pull request #2336 from colinleroy/optimize-strdup
...
Optimize strdup
2024-01-08 22:13:43 +01:00
Bob Andrews
e1065d0c89
Merge pull request #2342 from colinleroy/rework-mktime
...
Rework time functions a bit
2024-01-08 22:13:05 +01:00
Bob Andrews
a71865f6ec
Merge pull request #2331 from acqn/FuncDeclFix
...
[cc65] Fixed calling convention parsing in type names and function parameter types
2024-01-08 21:58:01 +01:00
Colin Leroy-Mira
df193c0947
Rework time functions a bit
...
- mktime: Work unsigned as time_t's type implies (shifting Y2K38 bug to 2106)
- mktime: Add unit tests
- gmtime/localtime: factorize
- gmtime/localtime: Add unit tests
- mktime/gmtime/localtime: Size optimisation (-130 bytes wrt master)
- mktime: Speed optimisation (from 23M cycles on the unit test to 2M)
2024-01-08 18:24:13 +01:00
mrdudz
29801a2fde
remove extra format specifier, fixed #2330
2024-01-06 17:53:24 +01:00
Colin Leroy-Mira
169c9c0da0
Add strdup tests
2024-01-05 22:26:06 +01:00
acqn
7aab84628d
Fixed calling convention parsing in type names and function parameter types.
2024-01-01 16:11:30 +08:00
acqn
1e4d1b4311
Fixed function declarator parser when a parameter has a function type.
...
Ensured check on parameter lists without types in non-definition declarations.
2023-12-14 02:34:03 +08:00
acqn
b66682a05b
Fixed wrapped call when the function to wrap has already got defined before it is wrapped with the pragma.
2023-12-10 00:47:10 +08:00
mrdudz
b31a1c7c0c
test for regression that occured after #2262
2023-12-10 22:18:59 +01:00
Colin Leroy-Mira
2a2cc6cad6
Fix bug introduced in #2260
...
bne should have applied to A, not X, but adding a cmp #$00 before
makes the change less optimized than the existing.
2023-12-09 16:43:23 +01:00
Bob Andrews
66bfc31988
Merge pull request #2262 from colinleroy/optimize-long-assign
...
Optimize static long assignment a bit
2023-12-08 01:58:01 +01:00
Colin Leroy-Mira
d8a3938f2b
Optimize a bit static long assignation
2023-12-01 14:20:00 +01:00
Bob Andrews
97cfb8c67a
Merge pull request #2266 from acqn/StructFix
...
[cc65] Fixes for structs/unions
2023-11-28 15:00:58 +01:00
Bob Andrews
86b09f56a6
Merge pull request #2260 from colinleroy/optimize-substraction
...
Optimize integer decrements by 1
2023-11-28 14:40:51 +01:00