/*-1* Copyright (c) 2015-2017 Ruslan Bukin <[email protected]>2* Copyright (c) 2021 Alex Richardson <[email protected]>3* All rights reserved.4*5* Portions of this software were developed by SRI International and the6* University of Cambridge Computer Laboratory under DARPA/AFRL contract7* FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.8*9* Portions of this software were developed by the University of Cambridge10* Computer Laboratory as part of the CTSRD Project, with support from the11* UK Higher Education Innovation Fund (HEIF).12*13* This work was supported by Innovate UK project 105694, "Digital Security14* by Design (DSbD) Technology Platform Prototype".15*16* Redistribution and use in source and binary forms, with or without17* modification, are permitted provided that the following conditions18* are met:19* 1. Redistributions of source code must retain the above copyright20* notice, this list of conditions and the following disclaimer.21* 2. Redistributions in binary form must reproduce the above copyright22* notice, this list of conditions and the following disclaimer in the23* documentation and/or other materials provided with the distribution.24*25* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND26* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE27* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE28* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE29* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL30* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS31* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)32* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT33* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY34* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF35* SUCH DAMAGE.36*/3738#include <machine/asm.h>39ENTRY(fabs)40#ifdef __riscv_float_abi_double41fabs.d fa0, fa042#else43slli a0, a0, 144srli a0, a0, 145#endif46ret47END(fabs)484950