Provide some function to group different load/store instructions.

Signed-off-by: Julien Thierry <jthie...@redhat.com>
---
 arch/arm64/include/asm/aarch64-insn.h | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/include/asm/aarch64-insn.h 
b/arch/arm64/include/asm/aarch64-insn.h
index 3a0e0ad51f5b..f1b5b652c400 100644
--- a/arch/arm64/include/asm/aarch64-insn.h
+++ b/arch/arm64/include/asm/aarch64-insn.h
@@ -408,6 +408,34 @@ static inline bool aarch64_insn_is_barrier(u32 insn)
               aarch64_insn_is_isb(insn);
 }
 
+static inline bool aarch64_insn_is_store_single(u32 insn)
+{
+       return aarch64_insn_is_store_imm(insn) ||
+              aarch64_insn_is_store_pre(insn) ||
+              aarch64_insn_is_store_post(insn);
+}
+
+static inline bool aarch64_insn_is_store_pair(u32 insn)
+{
+       return aarch64_insn_is_stp(insn) ||
+              aarch64_insn_is_stp_pre(insn) ||
+              aarch64_insn_is_stp_post(insn);
+}
+
+static inline bool aarch64_insn_is_load_single(u32 insn)
+{
+       return aarch64_insn_is_load_imm(insn) ||
+              aarch64_insn_is_load_pre(insn) ||
+              aarch64_insn_is_load_post(insn);
+}
+
+static inline bool aarch64_insn_is_load_pair(u32 insn)
+{
+       return aarch64_insn_is_ldp(insn) ||
+              aarch64_insn_is_ldp_pre(insn) ||
+              aarch64_insn_is_ldp_post(insn);
+}
+
 enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn);
 bool aarch64_insn_uses_literal(u32 insn);
 bool aarch64_insn_is_branch(u32 insn);
-- 
2.25.4

Reply via email to