提交 077513b8 编写于 作者: R Russell King 提交者: Daniel Borkmann

ARM: net: bpf: improve 64-bit sign-extended immediate load

Improve the 64-bit sign-extended immediate from:

  mov     r6, #1
  str     r6, [fp, #-52]  ; 0xffffffcc
  mov     r6, #0
  str     r6, [fp, #-48]  ; 0xffffffd0

to:

  mov     r6, #1
  mov     r7, #0
  strd    r6, [fp, #-52]  ; 0xffffffcc
Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 f9ff5018
...@@ -613,12 +613,11 @@ static void emit_a32_mov_i64(const s8 dst[], u64 val, struct jit_ctx *ctx) ...@@ -613,12 +613,11 @@ static void emit_a32_mov_i64(const s8 dst[], u64 val, struct jit_ctx *ctx)
/* Sign extended move */ /* Sign extended move */
static inline void emit_a32_mov_se_i64(const bool is64, const s8 dst[], static inline void emit_a32_mov_se_i64(const bool is64, const s8 dst[],
const u32 val, struct jit_ctx *ctx) { const u32 val, struct jit_ctx *ctx) {
u32 hi = 0; u64 val64 = val;
if (is64 && (val & (1<<31))) if (is64 && (val & (1<<31)))
hi = (u32)~0; val64 |= 0xffffffff00000000ULL;
emit_a32_mov_i(dst_lo, val, ctx); emit_a32_mov_i64(dst, val64, ctx);
emit_a32_mov_i(dst_hi, hi, ctx);
} }
static inline void emit_a32_add_r(const u8 dst, const u8 src, static inline void emit_a32_add_r(const u8 dst, const u8 src,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册