diff options
| author | jiladahe1997 <[email protected]> | 2021-12-09 11:22:46 +0800 |
|---|---|---|
| committer | jiladahe1997 <[email protected]> | 2021-12-09 11:22:46 +0800 |
| commit | 433e5f81473f71e36fbfb2a4ca5fcbb6b28f57b2 (patch) | |
| tree | 90d431ce948e21a45ae03d1520b98b6a2f7efeae /libcpu/arm/cortex-m33 | |
| parent | fd9eea2f7ff88862d61687e0376ad8b884693db9 (diff) | |
[bugfix] libcpu/arm/cortex-m/context_gcc: 修复thumb指令集汇编语法错误
当使用thumb指令集时,要求汇编语法中的“条件执行”要跟在IT指令后面,否则会编译不通过。
报错如下:Error: thumb conditional instruction should be in IT block -- `moveq r4,#0x01'
虽然可以通过指定"-Wa,-mimplicit-it=thumb"选项来告诉编译器识别隐式的IT指令,但是能在代码里面直接加上IT指令的话更好。
thumb指令集“条件执行”arm官网文档:
https://developer.arm.com/documentation/dui0473/m/condition-codes/conditional-execution-in-thumb-state
参考论坛帖子:
https://club.rt-thread.org/ask/question/433887.html
https://club.rt-thread.org/ask/question/4188.html
Signed-off-by: Mingrui Ren <[email protected]>
Diffstat (limited to 'libcpu/arm/cortex-m33')
| -rw-r--r-- | libcpu/arm/cortex-m33/context_gcc.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcpu/arm/cortex-m33/context_gcc.S b/libcpu/arm/cortex-m33/context_gcc.S index 27596bf787..3c4ac8a236 100644 --- a/libcpu/arm/cortex-m33/context_gcc.S +++ b/libcpu/arm/cortex-m33/context_gcc.S @@ -143,6 +143,7 @@ contex_ns_store: #if defined (__VFP_FP__) && !defined(__SOFTFP__) TST lr, #0x10 /* if(!EXC_RETURN[4]) */ + IT EQ VSTMDBEQ r1!, {d8 - d15} /* push FPU register s16~s31 */ #endif @@ -187,6 +188,7 @@ contex_ns_load: #if defined (__VFP_FP__) && !defined(__SOFTFP__) TST lr, #0x10 /* if(!EXC_RETURN[4]) */ + IT EQ VLDMIAEQ r1!, {d8 - d15} /* pop FPU register s16~s31 */ #endif |
