compile-time-init-build icon indicating copy to clipboard operation
compile-time-init-build copied to clipboard

'msg::handler' interface: allow messages to pass by value

Open lukevalenty opened this issue 1 year ago • 1 comments
trafficstars

Some embedded architectures, ABIs, message sizes, and compilers may benefit from passing messages by value rather than reference.

For example, in-order RISC processors that can pass the entire message struct by value in registers are a good candidate.

This saves storing the message to memory and retrieving it from memory for each callback.

Benchmarking pass-by-reference vs pass-by-value for an individual use case will still be useful to determine which option is better for that use case.

lukevalenty avatar Dec 23 '23 17:12 lukevalenty

Clang has the builtin function __can_pass_in_regs(type) which might be useful, but I don't know if there is a similar intrinsic for GCC or whether it is widely applicable.

elbeno avatar May 21 '24 01:05 elbeno

@lukevalenty Is this addressed by https://github.com/intel/compile-time-init-build/pull/615 ?

elbeno avatar Oct 30 '24 21:10 elbeno

Yes, I think it is addressed by #615.

lukevalenty avatar Nov 06 '24 17:11 lukevalenty