lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH bpf-next 6/8] arm32, bpf: add support for 64 bit division instruction
On Tue, Sep 05, 2023 at 09:06:19PM +0000, Puranjay Mohan wrote:
> +cont:
> +
> + /* Call appropriate function */
> + if (sign)
> + emit_mov_i(ARM_IP, op == BPF_DIV ? (u32)jit_sdiv64 : (u32)jit_smod64, ctx);
> + else
> + emit_mov_i(ARM_IP, op == BPF_DIV ? (u32)jit_udiv64 : (u32)jit_mod64, ctx);

Same comment as the previous patch here.

> +
> + emit_blx_r(ARM_IP, ctx);
> +
> + /* Save return value */
> + if (rd[1] != ARM_R0) {
> + emit(ARM_MOV_R(rd[0], ARM_R1), ctx);
> + emit(ARM_MOV_R(rd[1], ARM_R0), ctx);
> + }
> +
> + /* Recover {R1, R0} from stack if it is not Rd */
> + if (rd[1] != ARM_R0)
> + emit(ARM_POP(BIT(ARM_R0) | BIT(ARM_R1)), ctx);
> + else
> + emit(ARM_ADD_I(ARM_SP, ARM_SP, 8), ctx);
> +
> + /* Recover {R3, R2} from stack if it is not Rd */
> + if (rd[1] != ARM_R2)
> + emit(ARM_POP(BIT(ARM_R2) | BIT(ARM_R3)), ctx);
> + else
> + emit(ARM_ADD_I(ARM_SP, ARM_SP, 8), ctx);

if (rd[1] != ARM_R0) {
emit(ARM_POP(BIT(ARM_R0) | BIT(ARM_R1)), ctx);
emit(ARM_ADD_I(ARM_SP, ARM_SP, 8), ctx);
} else if (rd[1] != ARM_R2) {
emit(ARM_ADD_I(ARM_SP, ARM_SP, 8), ctx);
emit(ARM_POP(BIT(ARM_R2) | BIT(ARM_R3)), ctx);
} else {
emit(ARM_ADD_I(ARM_SP, ARM_SP, 16), ctx);
}

Hmm?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

\
 
 \ /
  Last update: 2023-09-05 23:54    [W:0.107 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site