We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear Sir,
How to disable floating-point instruction generation with aarch64 GCC compiler ?
We want to use software to do floating-point calculation.
But always has error messages as below:
aarch64-linux-gnu-gcc -mcpu=cortex-a53+nofp test.ctest.c: In function 'main':test.c:24:11: error: '+nofp' feature modifier is incompatible with floating-point code float aa = 0.0; ^test.c:28:12: error: '+nofp' feature modifier is incompatible with floating-point argument aa += 3.0; ^test.c:28:12: error: '+nofp' feature modifier is incompatible with floating-point argumenttest.c:28:12: error: '+nofp' feature modifier is incompatible with floating-point codetest.c:28: confused by earlier errors, bailing out
Any suggestion is good.
Thank you.
test.c
#include <stdlib.h>#include <stdio.h>
/* * void main(void) * the application start point for the primary CPU * * Inputs * <none> * * Returns * subroutine does not return */int main(void){ float aa = 0.0; int i;
for(i = 0; i < 1024; i++) { aa += 3.0; }
if (aa > 1000.0) exit(1); else exit(2);
return 0;}