Code replacement for "abs" is "mw_arm_abs_f32" instead of "fabs"
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 30 de En. de 2017
Respondida: MathWorks Support Team
el 16 de Feb. de 2017
I am attempting to generate code for the ARM Cortex-M using Embedded Coder. I am using a code replacement library in order to do this but it is not working correctly because the code generation process is replacing the calls to "abs" with "mw_arm_abs_f32" instead of the expected "fabs". How can I get code to be generated using the "fabs" function?
Respuesta aceptada
MathWorks Support Team
el 16 de Feb. de 2017
Code replacement during the code generation process is based on a series of constraints. If these constraints are met for a given case, the code is replaced with the specific function. You can view the code replacement table for the ARM Cortex-M using the command below:
RTW.viewTfl('ARM Cortex-M')
You will be able to see the constraints which must be met in order for each replacement to happen. As can be seen in the "In1Type" section for the "mw_arm_abs_f32" replacement, the size is a column vector of singles. Therefore, if you want to avoid this replacement being applied, you must ensure the size of the input is a 1x1 variable. If none of the replacement constraints are met, "fabs" will be used.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!