]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
include: opcodes: aarch64: define new subclasses
authorIndu Bhagat <indu.bhagat@oracle.com>
Fri, 19 Jul 2024 03:24:10 +0000 (20:24 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Fri, 19 Jul 2024 03:54:14 +0000 (20:54 -0700)
commit04521e258ee8f2e4e27d242a2e34047cfc1ccd11
treea015ab9ec221b002152e274492abd516f13091dd
parentaf4eb9e20a6b4d9a5e61d9caaf89daf4c3742150
include: opcodes: aarch64: define new subclasses

The existing iclass information tells us the general shape and purpose
of the instructions.  In some cases, however, we need to further disect
the iclass on the basis of other finer-grain information.  E.g., for the
purpose of SCFI, we need to know whether a given insn with iclass of
ldst_* is a load or a store.  Similarly, whether a particular arithmetic
insn is an add or sub or mov, etc.

This patch defines new flags to demarcate the insns.  Also provide an
access function for subclass lookup.

Later, we will enforce (in aarch64-gen.c) that if an iclass has at least
one instruction with a non-zero subclass, all instructions of the iclass
must have a non-zero subclass information.  If none of the defined
subclasses are applicable (or not required for SCFI purposes),
F_SUBCLASS_OTHER can be used for such instructions.

include/
        * opcode/aarch64.h (F_SUBCLASS): New flag.
        (F_SUBCLASS_OTHER): Likewise.
        (F_LDST_LOAD): Likewise.
        (F_LDST_STORE): Likewise.
        (F_ARITH_ADD): Likewise.
        (F_ARITH_SUB): Likewise.
        (F_ARITH_MOV): Likewise.
        (F_BRANCH_CALL): Likewise.
        (F_BRANCH_RET): Likewise.
(F_DP_TAG_ONLY): Likewise.
        (aarch64_opcode_subclass_p): New definition.
include/opcode/aarch64.h