Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to HuCC's expression handling that make the code faster, but not smaller. #47

Merged
merged 5 commits into from
Oct 3, 2024

Commits on Sep 29, 2024

  1. Configuration menu
    Copy the full SHA
    18c069a View commit details
    Browse the repository at this point in the history
  2. Update HuCC's hucc-string.h to make it easier to switch between the

    current short string pointer and the work-in-progress far string
    pointer.
    jbrandwood committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    65f53b7 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Change how HuCC generates the names for static local variables so tha…

    …t they are
    
    symbols and not labels.
    
    Defer the address addition for static local and norecursive arrays so that they
    can take advantage of the same peephole optimization rules as global arrays.
    
    Display static and norecursive function local variable names as comments in the
    listing file so that it is easier to see what the generated code is doing.
    
    Change how the expression handler decides if an lvalue is unsigned to hopefully
    make it a bit less error-prone.
    
    Add some of SmallC-85's comments to expr.c to try to make the source code a bit
    more readable.
    jbrandwood committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    9bc0d91 View commit details
    Browse the repository at this point in the history
  2. Change HuCC's use of "JSR aslw/asrw/lsrw" into distinct i-codes so

    that they're cleaner to optimize.
    jbrandwood committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    a4ae413 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2024

  1. Add some missing rules for constant expressions to HuCC's peephole op…

    …timizer so
    
    that they can be recursively calculated and resolved into integers.
    
    Reorganize the optimizer so that math with an integer is optimized early on and
    doesn't get in the way of more-complex later optimizations.
    
    Change HuCC's "jsr smul/sdiv" into i-codes to remove the I_JSR and T_LIB string
    comparisons that are a PITA to deal with in the optimizer, and add new multiply
    and divide by an integer i-codes.
    
    Add some rules to convert signed multiply and divide into unsigned if possible,
    and then to convert unsigned power-of-two divide or mod into LSR or AND.
    
    Allow the instruction rescheduler to reorder multiplies as they're commutative.
    jbrandwood committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    44d752b View commit details
    Browse the repository at this point in the history