Files
gasm-sdk/testdata/verify/abi_loong64.s
T

22 lines
574 B
ArmAsm
Raw Normal View History

// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: BSD-3-Clause
#include "textflag.h"
// func cleanAdd(a, b int64) int64
// A well-behaved function that preserves the goroutine pointer.
TEXT ·cleanAdd(SB), NOSPLIT, $0-24
MOVV a+0(FP), R4
MOVV b+8(FP), R5
ADDV R4, R5, R4
MOVV R4, ret+16(FP)
RET
// func dirtyG(a int64) int64
// Deliberately clobbers R22, the goroutine pointer (a serious ABI violation).
TEXT ·dirtyG(SB), NOSPLIT, $0-16
MOVV $0x5678, R22
MOVV a+0(FP), R4
MOVV R4, ret+8(FP)
RET