Menu

#1029 Ports shouldn't use __memcpy for struct assignment when there are better alternatives

None
open
None
5
4 hours ago
4 hours ago
No

In current, both the z80 and the r3ka port use __memcpy to implement struct assignment. Which is correct, but inefficient, since both have a builtin for memcpy that should be used instead (and AFAIR was used in the past).

P.S.: This is a regression vs. SDCC 4.5.0.

Discussion

  • Philipp Klaus Krause

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,3 @@
     In current, both the z80 and the r3ka port use `__memcpy` to implement struct assignment.  Which is correct, but inefficient, since both have a builtin for `memcpy` that should be used instead (and AFAIR was used in the past).
    +
    +P.S.: This is a regression vs SDCC 4.5.0.
    
    • Group: -->
     
  • Philipp Klaus Krause

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,3 @@
     In current, both the z80 and the r3ka port use `__memcpy` to implement struct assignment.  Which is correct, but inefficient, since both have a builtin for `memcpy` that should be used instead (and AFAIR was used in the past).
    
    -P.S.: This is a regression vs SDCC 4.5.0.
    +P.S.: This is a regression vs. SDCC 4.5.0.
    
     
  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    memcpy is special among the builtin functions, since it is both-port-specific, and used by SDCC for struct handling. Looks like the check if it is available happens before processing the list of available functions from ports.

     

Log in to post a comment.

Auth0 Logo