You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Versions of the CMSE example code that use the new instructions in Armv8.1-M should be created. While some of the instructions (EG CLRM and VSCCLRM) just provide performance and code size improvements, correct usage of the new FPCXT payloads is required to fix an ABI issue.
For example:
Many examples (including sections 8.3.1, 8.3.2, 8.3.3, 8.4.2) have a long string of mov r?, #0 instructions to clear the registers. These can be replaced by the new CLRM clear multiple instruction.
The FPCXTS payload should be saved and restored around a Secure -> Non-secure call. This should be incorporated into the example shown in section 8.3.1
The FPCXTNS payload should be saved and restored on entry/exit from a cmse_nonsecure_entry function that either uses floating point, or calls another function that may use floating-point. This could be added to a new version of the example in section 8.4.2, although it might be cleaner to have a simpler example that doesn’t also involve stacked arguments.
Section 8.4.2 contains the following code to detect if an FP context is active, and to clear the registers if they contain secure data:
@14: check SFPA bit to see if FP is used
mrs r1, control
tst r1, #8
bne .LdoneFP
@15: clear floating point caller-saved registers (soft ABI)
mov r1, #0
vmov s0, s1, r1, r1
vmov s2, s3, r1, r1
...
vmov s30, s31, r1, r1
@16: clear floating point flags
vmsr fpscr, r1
.LdoneFP:
This code can be replaced by the new VSCCLRM instruction
The text was updated successfully, but these errors were encountered:
Versions of the CMSE example code that use the new instructions in Armv8.1-M should be created. While some of the instructions (EG CLRM and VSCCLRM) just provide performance and code size improvements, correct usage of the new FPCXT payloads is required to fix an ABI issue.
For example:
Many examples (including sections 8.3.1, 8.3.2, 8.3.3, 8.4.2) have a long string of
mov r?, #0
instructions to clear the registers. These can be replaced by the newCLRM
clear multiple instruction.The
FPCXTS
payload should be saved and restored around a Secure -> Non-secure call. This should be incorporated into the example shown in section 8.3.1The
FPCXTNS
payload should be saved and restored on entry/exit from acmse_nonsecure_entry
function that either uses floating point, or calls another function that may use floating-point. This could be added to a new version of the example in section 8.4.2, although it might be cleaner to have a simpler example that doesn’t also involve stacked arguments.Section 8.4.2 contains the following code to detect if an FP context is active, and to clear the registers if they contain secure data:
This code can be replaced by the new
VSCCLRM
instructionThe text was updated successfully, but these errors were encountered: