consolidate cbz/cbnz macros to pseudo.S

This commit is contained in:
Chris Copeland 2024-03-18 23:23:08 -07:00
parent bf750c75f6
commit ace7733ebd
Signed by: chrisnc
GPG Key ID: 14550DA72485DF30
3 changed files with 15 additions and 14 deletions

View File

@ -21,16 +21,6 @@
.thumb
#else // arm
.arm
// arm mode doesn't have cbz/cbnz, so make our own.
.macro cbz reg, label
cmp \reg, 0
beq \label
.endm
.macro cbnz reg, label
cmp \reg, 0
bne \label
.endm
#endif // __thumb__
#if RT_ARM_FP

View File

@ -1,6 +1,21 @@
#pragma once
#include <rt/arch/profile.h>
.macro mov32 reg, literal
movw \reg, :lower16:\literal
movt \reg, :upper16:\literal
.endm
#if !defined(__thumb__) || RT_ARM_V6M
// arm mode and v6m don't have cbz/cbnz, so make our own.
.macro cbz reg, label
cmp \reg, 0
beq \label
.endm
.macro cbnz reg, label
cmp \reg, 0
bne \label
.endm
#endif // !defined(__thumb__) || RT_ARM_V6M

View File

@ -66,10 +66,6 @@
#define psplimtemp
#define getpsplim
#define setpsplim
.macro cbz reg, label
cmp \reg, 0
beq \label
.endm
#endif // __ARM_ARCH
#define CONTEXT_SIZE (32 + PSPLIM_SIZE + CONTROL_SIZE)