This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What optimizations should be expected from a C compiler for small uPs?

My knowledge of current compiler optimization technology is very limited (or ancient).
Am familiar with VHDL and Verilog for FPGA chips where extreme optimization is typical (dead code removal, code duplication to meet performance constraints, morphing from the language constructs into available hardware constructs).

In the context of the large variety of small microprocessors (of 8, 16 or 32 bits), each with unique peripheral collections; what would raise the coding to higher levels of abstraction, given one is still dealing with IO ports and peripherals?

Parents
  • "Trying to understand if it's possible to unify sbit variables with mask & write for non-bit IOs."

    It was a rather round-about way to ask that question!

    The bit-addressable stuff is very specific to the 8051, so it's not really going to be portable at all.

    And not all 8051 data is bit addressable - so you can't even really have anything "generic" just for the 8051.
    It's a feature of certain addresses that you can choose to either use or not.

    It's The normal tradeoff: you can take advantage of all the specifics of the architecture, and gain its maximum performance - or can can stick to generics that'll work anywhere and give you portability.

    This doesn't really have anything to do with compiler optimisation - it's about how you write your code in the first place.

Reply
  • "Trying to understand if it's possible to unify sbit variables with mask & write for non-bit IOs."

    It was a rather round-about way to ask that question!

    The bit-addressable stuff is very specific to the 8051, so it's not really going to be portable at all.

    And not all 8051 data is bit addressable - so you can't even really have anything "generic" just for the 8051.
    It's a feature of certain addresses that you can choose to either use or not.

    It's The normal tradeoff: you can take advantage of all the specifics of the architecture, and gain its maximum performance - or can can stick to generics that'll work anywhere and give you portability.

    This doesn't really have anything to do with compiler optimisation - it's about how you write your code in the first place.

Children
No data