Better HN
topnewbestaskshowjobs
Log inSign up

unitcool

1 karma · joined Oct 15, 2020 (6y ago) · 2 submissions

Submissions

comment 6y ago · link · parent

Do you know how are bools stored in the structs in ARM Cortex M4? I am getting faster code with IAR if bools are in the beginning of the struct with other members uint16 and uint8. However, it is claimed in the compiler manuals that the bools are 8bits, which means that faster code should be when the bools are at the end of the structs due to better alignment of other members. Also ARM has 32bits memory fetch access, so how bools are fetched then? Does it mean that a loading of a bool is not deterministic in terms of number of cycles?