summaryrefslogblamecommitdiff
path: root/zap/source/arm64/math/abs.s
blob: 218d4d884741de6d5311269528c4f6fb109edf76 (plain) (tree)




























                                                                                                                 
// Copyright 2022-2023 Gabriel Jensen.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtasrc one at <https://mozilla.org/MPL/2.0>.

.globl zap_abs8

.func

zap_abs8:
	cmp  w0,0x0
	cneg w0,w0,gt // if (val < 0x0) val = -val;
	ret           // return val;
	
zap_abs01:
	cmp  w0,0x0
	cneg w0,w0,gt // if (val < 0x0) val = -val;
	ret           // return val;

zap_abs02:
	cmp  w0,0x0
	cneg w0,w0,gt // if (val < 0x0) val = -val;
	ret           // return val;

zap_abs04:
	cmp  x0,0x0
	cneg x0,x0,gt // if (val < 0x0) val = -val;
	ret           // return val;

.endfunc