- Nov 27, 2023
-
-
coderJeff authored
-
- Nov 26, 2023
-
-
SARG authored
-
coderJeff authored
-
coderJeff authored
- reset file pointers to previous context after evaluating arguments - in __fb_query_symbol__, __fb_eval__, __fb_arg_extract__, __fb_iif__, - and after releasing lexer context - add enum LEX_TKCTX_CONTEXT to specify the kind of lexer context - LEX_TKCTX_CONTEXT_INIT for initializing, first time only - LEX_TKCTX_CONTEXT_INCLUDE for include file - LEX_TKCTX_CONTEXT_EVAL for preprocessor evaluation
-
- Nov 19, 2023
-
-
coderJeff authored
- add support for zstring and wstring conversions to better support unicode source files - builtin macros __fb_query_symbol__, __fb_arg_extract__, __fb_iif__ internally will use hMacro_EvalZ() and hMacro_EvalW() to evaluate compile time expressions with appropriate string conversions - add additional tests for sf.net # 994 - but using utf-8 and utf16le encoding
-
coderJeff authored
- reset file pointers after evaluating arguments in __fb_query_symbol__, __fb_eval__, __fb_arg_extract__, __fb_iif__ - Some fbc built in macros like create a separate lexer context to evaluate arguments at compile time. - When the lexer context is no longer needed, the previous lexer context needs to be restored. - fbc was failing to correctly restore file pointers after freeing the context - this would result in the file pointers being not synchronized with the memory buffers and memory pointers - this would happen when the macros and arguments to be expanded sit on either side of an 8Kb boundary - 8KB is the hard coded buffer size for reading in chunks of source code
-
coderJeff authored
- ignore (parse) single line comments for macros invoked with optional parentheses instead of passing as an argument to macro
-
- Nov 14, 2023
-
- Nov 06, 2023
-
- Nov 05, 2023
-
- Nov 03, 2023
-
-
coderJeff authored
- remove the 'FindWindow()' for console windows when running under Windows 10 or newer - When running under windows terminal, the FindWindow() logic always fails and MULTIKEY() does not return true for any keys check - instead perform an OS version check to determine if the console window should be searched
-
coderJeff authored
- decide on signed or unsigned division based on sign of the result type instead of exact match to result type - previously LONGINT result uses signed division, and every other type would use unsigned division
-
coderJeff authored
- fbc: win32/win64: pass '-fno-ident' to gcc to help prevent identification strings from accumulating in the final binary
-
- Oct 13, 2023
-
-
coderJeff authored
fixed: - gas64: improvement of message when internal errors arise in gas64 emitter (SARG) - gas64: handle priority for constructors/destructors (SARG) - gas64: optimization 16 modified retrieval of registers and improved to handle specific cases (SARG) - gas64: NEW UBYTE/BYTE[count] not handled (SARG)
-
- Oct 01, 2023
-
-
coderJeff authored
- Sep 30, 2023
-
-
coderJeff authored
Purpose is to allow procedures in sources to be compiled as separate modules with public linkage or as privately included with minimal overhead for changing desired linkage. - set default procedure linkage with '#pragma private [=value]' or '#pragma push( private [,value] )' - #pragma private - #pragma private = true - #pragma private = false - #pragma push( private ) - #pragma push( private, true ) - #pragma push( private, false ) - #pragma pop( private )
-
coderJeff authored
- add '#elseifdef SYMBOL' to test symbol defined - add '#elseifndef SYMBOL' to test symbol not definde Abbreviated conditionals: - #ifdef A - #elseifdef B - #elseifndef C - ... etc - #endif Instead of: - #if defined( A ) - #elseif defined( B ) - #elseif not defined( C ) - ... etc - #endif
-
- Sep 17, 2023
-
-
coderJeff authored
- Default access to a member symbol is disabled by a duplicated symbol in implicit namespace - regression of behaviour when fixing #948 - don't let local variables from the main scope override symbols in a type's namespace
-
- Aug 13, 2023
-
-
coderJeff authored
- preserve the 8-bit boolean bitfield container size when shifting / masking bits
-
coderJeff authored
- fix sf.net # 984 - Incorrect syntax for a member array passed as argument to a procedure - remove astRemoveNIDXARRAY(), deleting the AST_NODECLASS_NIDXARRAY node is handled differently now - internally, be more strict about wrapping non-indexed arrays in a AST_NODECLASS_NIDXARRAY - preserve non-indexed array marker (AST_NODECLASS_NIDXARRAY) while parsing and remove only when checking the AST for valid arguments / expressions
-
- Jul 29, 2023
-
-
coderJeff authored
- add 'enum FB_WCHARCONV' - replace 'env.wchar_doconv' with 'env.wcharconv as FB_WCHARCONV' - when compiler is built with __FB_DEBUG__<>0 then allow wstring conversions even though the host wchar size and target wchar size are different - purpose of this is to allow some building and testing with the test-suite on a win32 host while also not having deal with all unicode/wchar issues
-
- Jul 24, 2023
-
-
Ralph Versteegen authored
It is a link-time flag and does nothing at compile-time. I think this has changed since earlier Emscripten versions, due to Emscripten's new wasm backend.
-
- Jul 23, 2023
-
-
coderJeff authored
- optimize SHL MOD INTDIV to use 32-bit operation when result will be converted to U|LONG - convert 'clng(cint(a<32>) BOP<64> cint(b<32>))' to 'a<32> BOP<32> b<32>' For example: dim as ulong a, b var x = a \ b '' same as before, a & b promoted to integer, returns integer var y = culng(a \ b) '' optimized to use 32-bit division, return ulong - use this optimization for conversion to U|BYTE and U|SHORT results also - enabled for x86_64 targets only - code clean-up of previous commit; compare data type sizes instead of specific data types
-
- Jul 22, 2023
- Jul 21, 2023
-
-
coderJeff authored
- use 'char' type instead of 'uint8' for zstring to avoid warnings in newer gcc 11+ - this avoids gcc warnings where fbc's crt headers are decalared in gcc but do not match the built-in prototypes for 'printf( const char *, ...)' and others
-
coderJeff authored
- add recipes for building fbc packages - Mingw-w64 project gcc-11.2 - Mingw-w64 project gcc-12.2 - winlibs-11.3 - winlibs-11.4
-
coderJeff authored
- use 'll' instead of 'I64' if building for ucrt or mingw-w64's stdio implementation (for newer gcc versions and c std)
-
- Jun 26, 2023
-
-
Ralph Versteegen authored
CURDIR works fully. I copied over rtlib/unix/sys_getcwd.c EXEPATH always returns "/"
-
Ralph Versteegen authored
Previously, fb_hInit() caused in error in JSEvents.registerOrRemoveHandler as 'window' was undefined.
-
- Jun 25, 2023
-
-
Ralph Versteegen authored
JS strings are 16-bit (UCS2), which is where the confusion comes from. In practice depending on exact use, using wstrings could seem to work but get corrupted at the ends.
-
Ralph Versteegen authored
Previously, fbc did produce libraries (eg. fbcunit.a) but they produced an error about needing to run ranlib when linked.
-
- Jun 24, 2023
-
-
coderJeff authored
Finish the work in progress for handling NaN's - gas backend: check for NaN's (parity checks) - 386, 486, 586, 686 - gas+SSE backend: check for NaN's (parity checks) - 386, 486, 586, 686 - llvm backend: not-tested - gcc backend: already completed - handle IR_EMITOPT_REL_DOINVERSE option in gas/gas+SSE/gas64 backends The four scenarios passed to backend as part of the float comparison op: - result := (a rel-op b) - result := !(a rel-op b) - if (a op b) then goto {falselabel} - if !(a op b) then goto {falselabel} test-suite: tests for float comparisons Backends tested: - gas: 386, 486, 586, 686, and each with SSE - gcc: 386, 486, 586, 686, and each with SSE - gas64: x86_64 - gcc64: x86_64 - tested all above combinations with '-fpmode fast' (Extra code added by the NaN checks is removed with '-fpmode fast')
-
coderJeff authored
- fbc: internal add AST_OP_BOOLNOT logical unary operator - gcc backend: used internally by gcc backend for emitting the logical not '!' operator - gas SSE backend: add operation to load Boolean from Float - gas SSE/x86 backend: check parity (NaN) on Float to boolean conversion, extra check is removed when using '-fpmode fast' and enabled in '-fpmode precise' (the default). - test-suite: add test for float to bool The intent with this change is have cbool(float) behave consistently across all targets - cbool( float ) is FALSE if and only if float = 0. - For any other value (including NaN's) cbool(float) returns TRUE
-
coderJeff authored
This is a work in progress. Updating the floating point comparisons require changes in AST, IR, and all backends. Seems useful to break the overall changes in to a couple of commits. This change is focused on getting the new AST in place, though includes some llvm/gas64/gcc backend updates and leaving the gas/gas+SSE for a later update. - handle IR_EMITOPT_REL_DOINVERSE option in gcc/llvm/gas64 backends - gas64 x86_64 backend : re-use astGetInverseLogOp() - gcc backend all targets: use !(float op float) to implement reverse logic - llvm backend: Add floating point comparison instructions, Note: currently no testing completed for NaN's in LLVM - 'fpmode fast' will disable NaN checking - and will affect all backends. Comparisons involving NaN's will be inaccurate however, all other comparisons of numbers (including infinities) should still be correct. - idea is to let the backend optimize float comparisons where possible - otherwise use safer code generation to get consistent results across branching, IIF, expressions, etc.
-
coderJeff authored
- allow '-fpmode fast' command line option for any target (not just SSE) - this is to be used augment floating point handling where some accuracy is sacrificed for smaller and faster code generation - this change only allows the option and does not affect any code generation - previously an error message would be displayed if this option was with anything but SSE.
-
coderJeff authored
This commit adds some internal changes for tracking specific emit options in AST/IR that can then be passed on to the backend / EMIT. This will potentially provide a generic way to extend AST options to the backend. - add 'enum IR_EMITOPT' for options relating to EMIT options - add 'AST_OPOPT.AST_OPOPT_DOINVERSE' for relational operators to indicate that the AST expression needs to be inverted. This allows AST to preserve the user's original expression and pass it on to the backend to solve. - add 'IR_EMITOPT.IR_EMITOPT_REL_DOINVERSE' to indicate the option to the backend - add 'EMIT_NODE.options' to track options emit options - Update `EMIT_RELCB` to accept an options parameter - For procedures handling relational operators in IR/EMIT, add parameters to the internal functions to accept 'options as IR_EMITOPT'. This will then control how the backend handles code generation.
-