xref: /kernel/linux/linux-5.10/arch/arm64/net/bpf_jit.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * BPF JIT compiler for ARM64
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2014-2016 Zi Shen Lim <zlim.lnx@gmail.com>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef _BPF_JIT_H
88c2ecf20Sopenharmony_ci#define _BPF_JIT_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <asm/insn.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* 5-bit Register Operand */
138c2ecf20Sopenharmony_ci#define A64_R(x)	AARCH64_INSN_REG_##x
148c2ecf20Sopenharmony_ci#define A64_FP		AARCH64_INSN_REG_FP
158c2ecf20Sopenharmony_ci#define A64_LR		AARCH64_INSN_REG_LR
168c2ecf20Sopenharmony_ci#define A64_ZR		AARCH64_INSN_REG_ZR
178c2ecf20Sopenharmony_ci#define A64_SP		AARCH64_INSN_REG_SP
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define A64_VARIANT(sf) \
208c2ecf20Sopenharmony_ci	((sf) ? AARCH64_INSN_VARIANT_64BIT : AARCH64_INSN_VARIANT_32BIT)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/* Compare & branch (immediate) */
238c2ecf20Sopenharmony_ci#define A64_COMP_BRANCH(sf, Rt, offset, type) \
248c2ecf20Sopenharmony_ci	aarch64_insn_gen_comp_branch_imm(0, offset, Rt, A64_VARIANT(sf), \
258c2ecf20Sopenharmony_ci		AARCH64_INSN_BRANCH_COMP_##type)
268c2ecf20Sopenharmony_ci#define A64_CBZ(sf, Rt, imm19) A64_COMP_BRANCH(sf, Rt, (imm19) << 2, ZERO)
278c2ecf20Sopenharmony_ci#define A64_CBNZ(sf, Rt, imm19) A64_COMP_BRANCH(sf, Rt, (imm19) << 2, NONZERO)
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* Conditional branch (immediate) */
308c2ecf20Sopenharmony_ci#define A64_COND_BRANCH(cond, offset) \
318c2ecf20Sopenharmony_ci	aarch64_insn_gen_cond_branch_imm(0, offset, cond)
328c2ecf20Sopenharmony_ci#define A64_COND_EQ	AARCH64_INSN_COND_EQ /* == */
338c2ecf20Sopenharmony_ci#define A64_COND_NE	AARCH64_INSN_COND_NE /* != */
348c2ecf20Sopenharmony_ci#define A64_COND_CS	AARCH64_INSN_COND_CS /* unsigned >= */
358c2ecf20Sopenharmony_ci#define A64_COND_HI	AARCH64_INSN_COND_HI /* unsigned > */
368c2ecf20Sopenharmony_ci#define A64_COND_LS	AARCH64_INSN_COND_LS /* unsigned <= */
378c2ecf20Sopenharmony_ci#define A64_COND_CC	AARCH64_INSN_COND_CC /* unsigned < */
388c2ecf20Sopenharmony_ci#define A64_COND_GE	AARCH64_INSN_COND_GE /* signed >= */
398c2ecf20Sopenharmony_ci#define A64_COND_GT	AARCH64_INSN_COND_GT /* signed > */
408c2ecf20Sopenharmony_ci#define A64_COND_LE	AARCH64_INSN_COND_LE /* signed <= */
418c2ecf20Sopenharmony_ci#define A64_COND_LT	AARCH64_INSN_COND_LT /* signed < */
428c2ecf20Sopenharmony_ci#define A64_B_(cond, imm19) A64_COND_BRANCH(cond, (imm19) << 2)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* Unconditional branch (immediate) */
458c2ecf20Sopenharmony_ci#define A64_BRANCH(offset, type) aarch64_insn_gen_branch_imm(0, offset, \
468c2ecf20Sopenharmony_ci	AARCH64_INSN_BRANCH_##type)
478c2ecf20Sopenharmony_ci#define A64_B(imm26)  A64_BRANCH((imm26) << 2, NOLINK)
488c2ecf20Sopenharmony_ci#define A64_BL(imm26) A64_BRANCH((imm26) << 2, LINK)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/* Unconditional branch (register) */
518c2ecf20Sopenharmony_ci#define A64_BR(Rn)  aarch64_insn_gen_branch_reg(Rn, AARCH64_INSN_BRANCH_NOLINK)
528c2ecf20Sopenharmony_ci#define A64_BLR(Rn) aarch64_insn_gen_branch_reg(Rn, AARCH64_INSN_BRANCH_LINK)
538c2ecf20Sopenharmony_ci#define A64_RET(Rn) aarch64_insn_gen_branch_reg(Rn, AARCH64_INSN_BRANCH_RETURN)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Load/store register (register offset) */
568c2ecf20Sopenharmony_ci#define A64_LS_REG(Rt, Rn, Rm, size, type) \
578c2ecf20Sopenharmony_ci	aarch64_insn_gen_load_store_reg(Rt, Rn, Rm, \
588c2ecf20Sopenharmony_ci		AARCH64_INSN_SIZE_##size, \
598c2ecf20Sopenharmony_ci		AARCH64_INSN_LDST_##type##_REG_OFFSET)
608c2ecf20Sopenharmony_ci#define A64_STRB(Wt, Xn, Xm)  A64_LS_REG(Wt, Xn, Xm, 8, STORE)
618c2ecf20Sopenharmony_ci#define A64_LDRB(Wt, Xn, Xm)  A64_LS_REG(Wt, Xn, Xm, 8, LOAD)
628c2ecf20Sopenharmony_ci#define A64_STRH(Wt, Xn, Xm)  A64_LS_REG(Wt, Xn, Xm, 16, STORE)
638c2ecf20Sopenharmony_ci#define A64_LDRH(Wt, Xn, Xm)  A64_LS_REG(Wt, Xn, Xm, 16, LOAD)
648c2ecf20Sopenharmony_ci#define A64_STR32(Wt, Xn, Xm) A64_LS_REG(Wt, Xn, Xm, 32, STORE)
658c2ecf20Sopenharmony_ci#define A64_LDR32(Wt, Xn, Xm) A64_LS_REG(Wt, Xn, Xm, 32, LOAD)
668c2ecf20Sopenharmony_ci#define A64_STR64(Xt, Xn, Xm) A64_LS_REG(Xt, Xn, Xm, 64, STORE)
678c2ecf20Sopenharmony_ci#define A64_LDR64(Xt, Xn, Xm) A64_LS_REG(Xt, Xn, Xm, 64, LOAD)
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci/* Load/store register pair */
708c2ecf20Sopenharmony_ci#define A64_LS_PAIR(Rt, Rt2, Rn, offset, ls, type) \
718c2ecf20Sopenharmony_ci	aarch64_insn_gen_load_store_pair(Rt, Rt2, Rn, offset, \
728c2ecf20Sopenharmony_ci		AARCH64_INSN_VARIANT_64BIT, \
738c2ecf20Sopenharmony_ci		AARCH64_INSN_LDST_##ls##_PAIR_##type)
748c2ecf20Sopenharmony_ci/* Rn -= 16; Rn[0] = Rt; Rn[8] = Rt2; */
758c2ecf20Sopenharmony_ci#define A64_PUSH(Rt, Rt2, Rn) A64_LS_PAIR(Rt, Rt2, Rn, -16, STORE, PRE_INDEX)
768c2ecf20Sopenharmony_ci/* Rt = Rn[0]; Rt2 = Rn[8]; Rn += 16; */
778c2ecf20Sopenharmony_ci#define A64_POP(Rt, Rt2, Rn)  A64_LS_PAIR(Rt, Rt2, Rn, 16, LOAD, POST_INDEX)
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci/* Load/store exclusive */
808c2ecf20Sopenharmony_ci#define A64_SIZE(sf) \
818c2ecf20Sopenharmony_ci	((sf) ? AARCH64_INSN_SIZE_64 : AARCH64_INSN_SIZE_32)
828c2ecf20Sopenharmony_ci#define A64_LSX(sf, Rt, Rn, Rs, type) \
838c2ecf20Sopenharmony_ci	aarch64_insn_gen_load_store_ex(Rt, Rn, Rs, A64_SIZE(sf), \
848c2ecf20Sopenharmony_ci				       AARCH64_INSN_LDST_##type)
858c2ecf20Sopenharmony_ci/* Rt = [Rn]; (atomic) */
868c2ecf20Sopenharmony_ci#define A64_LDXR(sf, Rt, Rn) \
878c2ecf20Sopenharmony_ci	A64_LSX(sf, Rt, Rn, A64_ZR, LOAD_EX)
888c2ecf20Sopenharmony_ci/* [Rn] = Rt; (atomic) Rs = [state] */
898c2ecf20Sopenharmony_ci#define A64_STXR(sf, Rt, Rn, Rs) \
908c2ecf20Sopenharmony_ci	A64_LSX(sf, Rt, Rn, Rs, STORE_EX)
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci/* LSE atomics */
938c2ecf20Sopenharmony_ci#define A64_STADD(sf, Rn, Rs) \
948c2ecf20Sopenharmony_ci	aarch64_insn_gen_stadd(Rn, Rs, A64_SIZE(sf))
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci/* Add/subtract (immediate) */
978c2ecf20Sopenharmony_ci#define A64_ADDSUB_IMM(sf, Rd, Rn, imm12, type) \
988c2ecf20Sopenharmony_ci	aarch64_insn_gen_add_sub_imm(Rd, Rn, imm12, \
998c2ecf20Sopenharmony_ci		A64_VARIANT(sf), AARCH64_INSN_ADSB_##type)
1008c2ecf20Sopenharmony_ci/* Rd = Rn OP imm12 */
1018c2ecf20Sopenharmony_ci#define A64_ADD_I(sf, Rd, Rn, imm12) A64_ADDSUB_IMM(sf, Rd, Rn, imm12, ADD)
1028c2ecf20Sopenharmony_ci#define A64_SUB_I(sf, Rd, Rn, imm12) A64_ADDSUB_IMM(sf, Rd, Rn, imm12, SUB)
1038c2ecf20Sopenharmony_ci#define A64_ADDS_I(sf, Rd, Rn, imm12) \
1048c2ecf20Sopenharmony_ci	A64_ADDSUB_IMM(sf, Rd, Rn, imm12, ADD_SETFLAGS)
1058c2ecf20Sopenharmony_ci#define A64_SUBS_I(sf, Rd, Rn, imm12) \
1068c2ecf20Sopenharmony_ci	A64_ADDSUB_IMM(sf, Rd, Rn, imm12, SUB_SETFLAGS)
1078c2ecf20Sopenharmony_ci/* Rn + imm12; set condition flags */
1088c2ecf20Sopenharmony_ci#define A64_CMN_I(sf, Rn, imm12) A64_ADDS_I(sf, A64_ZR, Rn, imm12)
1098c2ecf20Sopenharmony_ci/* Rn - imm12; set condition flags */
1108c2ecf20Sopenharmony_ci#define A64_CMP_I(sf, Rn, imm12) A64_SUBS_I(sf, A64_ZR, Rn, imm12)
1118c2ecf20Sopenharmony_ci/* Rd = Rn */
1128c2ecf20Sopenharmony_ci#define A64_MOV(sf, Rd, Rn) A64_ADD_I(sf, Rd, Rn, 0)
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci/* Bitfield move */
1158c2ecf20Sopenharmony_ci#define A64_BITFIELD(sf, Rd, Rn, immr, imms, type) \
1168c2ecf20Sopenharmony_ci	aarch64_insn_gen_bitfield(Rd, Rn, immr, imms, \
1178c2ecf20Sopenharmony_ci		A64_VARIANT(sf), AARCH64_INSN_BITFIELD_MOVE_##type)
1188c2ecf20Sopenharmony_ci/* Signed, with sign replication to left and zeros to right */
1198c2ecf20Sopenharmony_ci#define A64_SBFM(sf, Rd, Rn, ir, is) A64_BITFIELD(sf, Rd, Rn, ir, is, SIGNED)
1208c2ecf20Sopenharmony_ci/* Unsigned, with zeros to left and right */
1218c2ecf20Sopenharmony_ci#define A64_UBFM(sf, Rd, Rn, ir, is) A64_BITFIELD(sf, Rd, Rn, ir, is, UNSIGNED)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci/* Rd = Rn << shift */
1248c2ecf20Sopenharmony_ci#define A64_LSL(sf, Rd, Rn, shift) ({	\
1258c2ecf20Sopenharmony_ci	int sz = (sf) ? 64 : 32;	\
1268c2ecf20Sopenharmony_ci	A64_UBFM(sf, Rd, Rn, (unsigned)-(shift) % sz, sz - 1 - (shift)); \
1278c2ecf20Sopenharmony_ci})
1288c2ecf20Sopenharmony_ci/* Rd = Rn >> shift */
1298c2ecf20Sopenharmony_ci#define A64_LSR(sf, Rd, Rn, shift) A64_UBFM(sf, Rd, Rn, shift, (sf) ? 63 : 31)
1308c2ecf20Sopenharmony_ci/* Rd = Rn >> shift; signed */
1318c2ecf20Sopenharmony_ci#define A64_ASR(sf, Rd, Rn, shift) A64_SBFM(sf, Rd, Rn, shift, (sf) ? 63 : 31)
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci/* Zero extend */
1348c2ecf20Sopenharmony_ci#define A64_UXTH(sf, Rd, Rn) A64_UBFM(sf, Rd, Rn, 0, 15)
1358c2ecf20Sopenharmony_ci#define A64_UXTW(sf, Rd, Rn) A64_UBFM(sf, Rd, Rn, 0, 31)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci/* Move wide (immediate) */
1388c2ecf20Sopenharmony_ci#define A64_MOVEW(sf, Rd, imm16, shift, type) \
1398c2ecf20Sopenharmony_ci	aarch64_insn_gen_movewide(Rd, imm16, shift, \
1408c2ecf20Sopenharmony_ci		A64_VARIANT(sf), AARCH64_INSN_MOVEWIDE_##type)
1418c2ecf20Sopenharmony_ci/* Rd = Zeros (for MOVZ);
1428c2ecf20Sopenharmony_ci * Rd |= imm16 << shift (where shift is {0, 16, 32, 48});
1438c2ecf20Sopenharmony_ci * Rd = ~Rd; (for MOVN); */
1448c2ecf20Sopenharmony_ci#define A64_MOVN(sf, Rd, imm16, shift) A64_MOVEW(sf, Rd, imm16, shift, INVERSE)
1458c2ecf20Sopenharmony_ci#define A64_MOVZ(sf, Rd, imm16, shift) A64_MOVEW(sf, Rd, imm16, shift, ZERO)
1468c2ecf20Sopenharmony_ci#define A64_MOVK(sf, Rd, imm16, shift) A64_MOVEW(sf, Rd, imm16, shift, KEEP)
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci/* Add/subtract (shifted register) */
1498c2ecf20Sopenharmony_ci#define A64_ADDSUB_SREG(sf, Rd, Rn, Rm, type) \
1508c2ecf20Sopenharmony_ci	aarch64_insn_gen_add_sub_shifted_reg(Rd, Rn, Rm, 0, \
1518c2ecf20Sopenharmony_ci		A64_VARIANT(sf), AARCH64_INSN_ADSB_##type)
1528c2ecf20Sopenharmony_ci/* Rd = Rn OP Rm */
1538c2ecf20Sopenharmony_ci#define A64_ADD(sf, Rd, Rn, Rm)  A64_ADDSUB_SREG(sf, Rd, Rn, Rm, ADD)
1548c2ecf20Sopenharmony_ci#define A64_SUB(sf, Rd, Rn, Rm)  A64_ADDSUB_SREG(sf, Rd, Rn, Rm, SUB)
1558c2ecf20Sopenharmony_ci#define A64_SUBS(sf, Rd, Rn, Rm) A64_ADDSUB_SREG(sf, Rd, Rn, Rm, SUB_SETFLAGS)
1568c2ecf20Sopenharmony_ci/* Rd = -Rm */
1578c2ecf20Sopenharmony_ci#define A64_NEG(sf, Rd, Rm) A64_SUB(sf, Rd, A64_ZR, Rm)
1588c2ecf20Sopenharmony_ci/* Rn - Rm; set condition flags */
1598c2ecf20Sopenharmony_ci#define A64_CMP(sf, Rn, Rm) A64_SUBS(sf, A64_ZR, Rn, Rm)
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci/* Data-processing (1 source) */
1628c2ecf20Sopenharmony_ci#define A64_DATA1(sf, Rd, Rn, type) aarch64_insn_gen_data1(Rd, Rn, \
1638c2ecf20Sopenharmony_ci	A64_VARIANT(sf), AARCH64_INSN_DATA1_##type)
1648c2ecf20Sopenharmony_ci/* Rd = BSWAPx(Rn) */
1658c2ecf20Sopenharmony_ci#define A64_REV16(sf, Rd, Rn) A64_DATA1(sf, Rd, Rn, REVERSE_16)
1668c2ecf20Sopenharmony_ci#define A64_REV32(sf, Rd, Rn) A64_DATA1(sf, Rd, Rn, REVERSE_32)
1678c2ecf20Sopenharmony_ci#define A64_REV64(Rd, Rn)     A64_DATA1(1, Rd, Rn, REVERSE_64)
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/* Data-processing (2 source) */
1708c2ecf20Sopenharmony_ci/* Rd = Rn OP Rm */
1718c2ecf20Sopenharmony_ci#define A64_DATA2(sf, Rd, Rn, Rm, type) aarch64_insn_gen_data2(Rd, Rn, Rm, \
1728c2ecf20Sopenharmony_ci	A64_VARIANT(sf), AARCH64_INSN_DATA2_##type)
1738c2ecf20Sopenharmony_ci#define A64_UDIV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, UDIV)
1748c2ecf20Sopenharmony_ci#define A64_LSLV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, LSLV)
1758c2ecf20Sopenharmony_ci#define A64_LSRV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, LSRV)
1768c2ecf20Sopenharmony_ci#define A64_ASRV(sf, Rd, Rn, Rm) A64_DATA2(sf, Rd, Rn, Rm, ASRV)
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/* Data-processing (3 source) */
1798c2ecf20Sopenharmony_ci/* Rd = Ra + Rn * Rm */
1808c2ecf20Sopenharmony_ci#define A64_MADD(sf, Rd, Ra, Rn, Rm) aarch64_insn_gen_data3(Rd, Ra, Rn, Rm, \
1818c2ecf20Sopenharmony_ci	A64_VARIANT(sf), AARCH64_INSN_DATA3_MADD)
1828c2ecf20Sopenharmony_ci/* Rd = Ra - Rn * Rm */
1838c2ecf20Sopenharmony_ci#define A64_MSUB(sf, Rd, Ra, Rn, Rm) aarch64_insn_gen_data3(Rd, Ra, Rn, Rm, \
1848c2ecf20Sopenharmony_ci	A64_VARIANT(sf), AARCH64_INSN_DATA3_MSUB)
1858c2ecf20Sopenharmony_ci/* Rd = Rn * Rm */
1868c2ecf20Sopenharmony_ci#define A64_MUL(sf, Rd, Rn, Rm) A64_MADD(sf, Rd, A64_ZR, Rn, Rm)
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci/* Logical (shifted register) */
1898c2ecf20Sopenharmony_ci#define A64_LOGIC_SREG(sf, Rd, Rn, Rm, type) \
1908c2ecf20Sopenharmony_ci	aarch64_insn_gen_logical_shifted_reg(Rd, Rn, Rm, 0, \
1918c2ecf20Sopenharmony_ci		A64_VARIANT(sf), AARCH64_INSN_LOGIC_##type)
1928c2ecf20Sopenharmony_ci/* Rd = Rn OP Rm */
1938c2ecf20Sopenharmony_ci#define A64_AND(sf, Rd, Rn, Rm)  A64_LOGIC_SREG(sf, Rd, Rn, Rm, AND)
1948c2ecf20Sopenharmony_ci#define A64_ORR(sf, Rd, Rn, Rm)  A64_LOGIC_SREG(sf, Rd, Rn, Rm, ORR)
1958c2ecf20Sopenharmony_ci#define A64_EOR(sf, Rd, Rn, Rm)  A64_LOGIC_SREG(sf, Rd, Rn, Rm, EOR)
1968c2ecf20Sopenharmony_ci#define A64_ANDS(sf, Rd, Rn, Rm) A64_LOGIC_SREG(sf, Rd, Rn, Rm, AND_SETFLAGS)
1978c2ecf20Sopenharmony_ci/* Rn & Rm; set condition flags */
1988c2ecf20Sopenharmony_ci#define A64_TST(sf, Rn, Rm) A64_ANDS(sf, A64_ZR, Rn, Rm)
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/* Logical (immediate) */
2018c2ecf20Sopenharmony_ci#define A64_LOGIC_IMM(sf, Rd, Rn, imm, type) ({ \
2028c2ecf20Sopenharmony_ci	u64 imm64 = (sf) ? (u64)imm : (u64)(u32)imm; \
2038c2ecf20Sopenharmony_ci	aarch64_insn_gen_logical_immediate(AARCH64_INSN_LOGIC_##type, \
2048c2ecf20Sopenharmony_ci		A64_VARIANT(sf), Rn, Rd, imm64); \
2058c2ecf20Sopenharmony_ci})
2068c2ecf20Sopenharmony_ci/* Rd = Rn OP imm */
2078c2ecf20Sopenharmony_ci#define A64_AND_I(sf, Rd, Rn, imm) A64_LOGIC_IMM(sf, Rd, Rn, imm, AND)
2088c2ecf20Sopenharmony_ci#define A64_ORR_I(sf, Rd, Rn, imm) A64_LOGIC_IMM(sf, Rd, Rn, imm, ORR)
2098c2ecf20Sopenharmony_ci#define A64_EOR_I(sf, Rd, Rn, imm) A64_LOGIC_IMM(sf, Rd, Rn, imm, EOR)
2108c2ecf20Sopenharmony_ci#define A64_ANDS_I(sf, Rd, Rn, imm) A64_LOGIC_IMM(sf, Rd, Rn, imm, AND_SETFLAGS)
2118c2ecf20Sopenharmony_ci/* Rn & imm; set condition flags */
2128c2ecf20Sopenharmony_ci#define A64_TST_I(sf, Rn, imm) A64_ANDS_I(sf, A64_ZR, Rn, imm)
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci/* HINTs */
2158c2ecf20Sopenharmony_ci#define A64_HINT(x) aarch64_insn_gen_hint(x)
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/* BTI */
2188c2ecf20Sopenharmony_ci#define A64_BTI_C  A64_HINT(AARCH64_INSN_HINT_BTIC)
2198c2ecf20Sopenharmony_ci#define A64_BTI_J  A64_HINT(AARCH64_INSN_HINT_BTIJ)
2208c2ecf20Sopenharmony_ci#define A64_BTI_JC A64_HINT(AARCH64_INSN_HINT_BTIJC)
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci#endif /* _BPF_JIT_H */
223