22 lines
475 B
ArmAsm
22 lines
475 B
ArmAsm
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// Differential kernel for the loong64 two-operand BEQ/BNE spellings the
|
|
// msan trampolines use: BEQ Rj, target compares against R0 (the beqz form).
|
|
|
|
#include "textflag.h"
|
|
|
|
TEXT ·branch2(SB), NOSPLIT, $0-8
|
|
MOVV arg+0(FP), R4
|
|
BEQ R4, zero
|
|
ADDV $1, R4, R4
|
|
|
|
zero:
|
|
MOVV $16, R5
|
|
BNE R4, done
|
|
ADDV $2, R4, R4
|
|
|
|
done:
|
|
MOVV R4, ret+0(FP)
|
|
RET
|