gcc have several --param for suggesting cache size (l1-cache-line-size l1-cache-size l2-cache-size)
However some processors/SoC (like the BCM6358) have separates caches for instructions and data. The documentation don't say which size to consider.
For example if you have a processor where you get those info with dmesg:
"Primary instruction cache 32kB, VIPT, 2-way, linesize 16 bytes" and "Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes"
You know the value for --param l1-cache-line-size is 16 but for l1-cache-size you don't know if it is 32Kb or 16Kb.
The size of cache line in L1 cache, in bytes.
The size of L1 cache, in kilobytes.
The size of L2 cache, in kilobytes.
This is talking about data cache size.
Ok. So, does it worth to make a change to the documentation?
An another possibility it to rename the parameter in this way:
l1-cache-size --> l1-data-cache-size
l2-cache-size --> l2-data-cache-size