鲍勃,
如果启用浮点代码编译(编译器命令行输入),PSoC Creator将自动启用浮点单元。默认情况下,PSoC Creator允许浮点代码编译为M4编译参数。您可以在“Project & gt;Bug设置& gt;CM4& gt;编译器”中检查,然后查看在右下角窗格中的灰色框中生成的编译器参数。下面的行指示编译器用FPU(M4中可用的一个)编译设备的代码。SoFTFP参数使用浮点参数传递到函数的普通CPU寄存器(RX),其中HADFP使用浮点寄存器(SX)来进行浮点参数传递。SOFTFP通常与大多数浮点库(已经编译和链接的库——如SIM/COS库)进行编译。HADFP需要HFFP库来进行正确的编译。
“-M浮标ABI=SOFTFP MFPU=FPV4-SP-D16”-用于GCC
浮点启用代码可在“StimultPSOC63YCM4.C”文件CysStudioIfPuEnable()函数中使用。请注意,此函数将仅启用FPU,如果编译器被指令生成如上所述的浮点代码,并且将从CM4启动代码自动调用。可以在您的应用程序中引用启用/禁用FPU的函数实现。
让我知道这是否有帮助。
当做,
Meenakshi Sundaram R
以上来自于百度翻译
以下为原文
Bob,
PSoC Creator enables the floating point unit automatically, if you enable floating point code compilation (compiler command line input). And by default PSoC Creator enables the floating point code compilation to compiler parameters for M4. You can check that in "Project > Build settings > CM4 > Compiler" and then looking at the compiler parameters generated in grey box on the bottom right side pane. The below line instructs the compiler to compile the code for a device with FPU (the one available in M4). softfp parameter uses normal CPU registers(Rx) for floating point argument passing to a function, where as hardfp use floating point registers(Sx) for floating point argument passing. softfp typically compiles with most floating point libraries (already compiled and linked libraries - like sin/cos libraries). hardfp require hardfp libraries for proper compilation.
"-mfloat-abi=softfp -mfpu=fpv4-sp-d16" - for GCC
The floating point enable code is available in "system_psoc63_cm4.c" file - Cy_SystemInitFpuEnable() function. Note that this function will only enable FPU if compiler is instructed to generate floating point code as mentioned above and is automatically called from the CM4 startup code. You can refer to the function implementation for enabling /disabling the FPU in you application.
Let me know if this helps.
Regards,
Meenakshi Sundaram R
鲍勃,
如果启用浮点代码编译(编译器命令行输入),PSoC Creator将自动启用浮点单元。默认情况下,PSoC Creator允许浮点代码编译为M4编译参数。您可以在“Project & gt;Bug设置& gt;CM4& gt;编译器”中检查,然后查看在右下角窗格中的灰色框中生成的编译器参数。下面的行指示编译器用FPU(M4中可用的一个)编译设备的代码。SoFTFP参数使用浮点参数传递到函数的普通CPU寄存器(RX),其中HADFP使用浮点寄存器(SX)来进行浮点参数传递。SOFTFP通常与大多数浮点库(已经编译和链接的库——如SIM/COS库)进行编译。HADFP需要HFFP库来进行正确的编译。
“-M浮标ABI=SOFTFP MFPU=FPV4-SP-D16”-用于GCC
浮点启用代码可在“StimultPSOC63YCM4.C”文件CysStudioIfPuEnable()函数中使用。请注意,此函数将仅启用FPU,如果编译器被指令生成如上所述的浮点代码,并且将从CM4启动代码自动调用。可以在您的应用程序中引用启用/禁用FPU的函数实现。
让我知道这是否有帮助。
当做,
Meenakshi Sundaram R
以上来自于百度翻译
以下为原文
Bob,
PSoC Creator enables the floating point unit automatically, if you enable floating point code compilation (compiler command line input). And by default PSoC Creator enables the floating point code compilation to compiler parameters for M4. You can check that in "Project > Build settings > CM4 > Compiler" and then looking at the compiler parameters generated in grey box on the bottom right side pane. The below line instructs the compiler to compile the code for a device with FPU (the one available in M4). softfp parameter uses normal CPU registers(Rx) for floating point argument passing to a function, where as hardfp use floating point registers(Sx) for floating point argument passing. softfp typically compiles with most floating point libraries (already compiled and linked libraries - like sin/cos libraries). hardfp require hardfp libraries for proper compilation.
"-mfloat-abi=softfp -mfpu=fpv4-sp-d16" - for GCC
The floating point enable code is available in "system_psoc63_cm4.c" file - Cy_SystemInitFpuEnable() function. Note that this function will only enable FPU if compiler is instructed to generate floating point code as mentioned above and is automatically called from the CM4 startup code. You can refer to the function implementation for enabling /disabling the FPU in you application.
Let me know if this helps.
Regards,
Meenakshi Sundaram R
举报