Спасибо. Но нужна пояснительная бригада (ещё не запускал
компиляцию, только настраиваю). Какими назначать -mcpu и -mtune? -mcpu=processor-string
Use architecture of and optimize the output for the given processor, specified by particular CPU name. Permissible values for this option are: ‘mips-p8700’, ‘sifive-e20’, ‘sifive-e21’, ‘sifive-e24’, ‘sifive-e31’, ‘sifive-e34’, ‘sifive-e76’, ‘sifive-s21’, ‘sifive-s51’, ‘sifive-s54’, ‘sifive-s76’, ‘sifive-u54’, ‘sifive-u74’, ‘sifive-x280’, ‘sifive-xp450’, ‘sifive-x670’, ‘thead-c906’, ‘tt-ascalon-d8’, ‘xiangshan-nanhu’, ‘xiangshan-kunminghu’, ‘xt-c908’, ‘xt-c908v’, ‘xt-c910’, ‘xt-c910v2’, ‘xt-c920’, ‘xt-c920v2’.
Note that -mcpu does not override -march or -mtune.
-mtune=processor-string
Optimize the output for the given processor, specified by microarchitecture or particular CPU name. Permissible values for this option are: ‘generic-ooo’, ‘mips-p8700’, ‘rocket’, ‘sifive-3-series’, ‘sifive-5-series’, ‘sifive-7-series’, ‘size’, ‘sifive-p400-series’, ‘sifive-p600-series’, and all valid options for -mcpu=.
When -mtune= is not specified, use the setting from -mcpu, the default is ‘rocket’ if both are not specified.
The ‘size’ choice is not intended for use by end-users. This is used when -Os is specified. It overrides the instruction cost info provided by -mtune=, but does not override the pipeline info. This helps reduce code size while still giving good performance.
Очень интересно, но ничего не понятно. Что указывать для CH32V317?
Нашёл ссылку с объяснениями от передовиков RISC-V:
https://www.sifive.com/blog/all-aboard-part-1-compiler-args
Верно ли я понимаю, что для, например, CH32V317, следует указать:
-march=rv32imafc //Достоверно известно, что ядро QingKe V4F поддерживает именно такие расширения (порядок букв из --print-multi-lib)
-mabi=ilp32f //Не знаю почему, но точно так. "f" если используется плавающая точка.
-mcpu=ch32v317 //Для максимально эффективной поддержки конкретного модельного ряда МК
-mcmodel=medlow //Минимум накладных расходов, но достаточный размер указателя для адресации всей доступный чипу памяти.
Так?
И ещё вопрос: что будет, если я выберу оптимизацию -O3? Не -Os и не -Ofast? Что-то пойдёт не так?