3 ms·
Or you could write an API like set(FOO | BAR) and get the same benefit for comparably basically no cost (+ now you get nice diffs in git).
by yakubin 3y ago
Or you could write an API like set(FOO | BAR) and get the same benefit for comparably basically no cost (+ now you get nice diffs in git).
- uticus 3y agogood point on nice diffs. collaborative work (using git or other source control) is really why text is king. there's no good way to collaborate, compare, etc with a low-code format.
- jackieooh 3y agoProblem is that some registers have non-zero default values (swd debug pin functions for example) so the set() function would still need to do a read modify write operation which isn't the theoretically optimal code gen.
- yakubin 3y agoThen it’s a question of annotating this function with ALWAYS_INLINE and letting the compiler optimise it.