Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Nov 27, 2023
  2. Nov 26, 2023
  3. Nov 19, 2023
    • coderJeff's avatar
      basic-macros: more support for wstring, zstring conversions · 80665c2c
      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
      80665c2c
    • coderJeff's avatar
      fbc: sf.net # 994: Bad handling of macro argument evaluation · 08fff057
      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
      08fff057
    • coderJeff's avatar
      sf.net # 993: handle single line comments after macros with optional parentheses · 20e3e616
      coderJeff authored
      - ignore (parse) single line comments for macros invoked with
        optional parentheses instead of passing as an argument to macro
      20e3e616
  4. Nov 14, 2023
  5. Nov 06, 2023
  6. Nov 05, 2023
    • coderJeff's avatar
      github # 421: add gcc compile option -fno-ident · a146bd87
      coderJeff authored
      - fbc: win32/win64: pass '-fno-ident' to gcc to help prevent
        identification strings from accumulating in the final binary
      
      (cherry picked from commit e6bc5cc7)
      
      Conflicts:
      - changelog.txt: resolve by adding the message to fbc-1.10.1 history
      a146bd87
  7. Nov 03, 2023
  8. Oct 13, 2023
    • coderJeff's avatar
      changelog.txt: for gas64 fixes · b1b476d8
      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)
      b1b476d8
  9. Oct 01, 2023
  10. Sep 30, 2023
    • coderJeff's avatar
      fbc: #pragma private · 7899fc7e
      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 )
      7899fc7e
    • coderJeff's avatar
      fbc: #ELSEIFDEF, #ELSEIFNDEF pre-processor conditional compilation directives · d1413d45
      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
      d1413d45
  11. Sep 17, 2023
  12. Aug 13, 2023
    • coderJeff's avatar
      fbc: github #292: Boolean bitfields writes treated as 32/64-bit rather than 8-bit · 8715208c
      coderJeff authored
      - preserve the 8-bit boolean bitfield container size when shifting / masking bits
      8715208c
    • coderJeff's avatar
      fbc: non-indexed arrays type checking · 8ee7cd4e
      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
      8ee7cd4e
  13. Jul 29, 2023
    • coderJeff's avatar
      fbc/emscripten: allow wchar conversion on win32 for development · 16b8e94f
      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
      16b8e94f
  14. Jul 24, 2023
  15. Jul 23, 2023
    • coderJeff's avatar
      fbc: x86_64: optimize SHL MOD INTDIV to use 32-bit operands · d7c91fd1
      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
      d7c91fd1
  16. Jul 22, 2023
  17. Jul 21, 2023
    • coderJeff's avatar
      - gcc backend: use 'char' types for zstring · aa8039ab
      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
      aa8039ab
    • coderJeff's avatar
      release: update build.sh · d6770c41
      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
      d6770c41
    • coderJeff's avatar
      rtlib: printf format specifier · 9352b6ec
      coderJeff authored
      - use 'll' instead of 'I64' if building for ucrt or
        mingw-w64's stdio implementation (for newer gcc
        versions and c std)
      9352b6ec
  18. Jun 26, 2023
  19. Jun 25, 2023
  20. Jun 24, 2023
    • coderJeff's avatar
      fbc: float comparisons to handle NaN's · 43838858
      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')
      43838858
    • coderJeff's avatar
      fbc: float to boolean conversion handling · 404c1171
      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
      404c1171
    • coderJeff's avatar
      fbc: float comparisons to handle NaN's (WIP) · 94db491b
      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.
      94db491b
    • coderJeff's avatar
      fbc: allow '-fpmode fast' command line option all targets · 01bab2bd
      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.
      01bab2bd
    • coderJeff's avatar
      fbc: internal: add IR_EMITOPT to control backend options from AST/IR · 479d88eb
      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.
      479d88eb
Loading