/*-1* Copyright (c) 2020 Axiado2* All rights reserved.3*4* This software was developed by Kristof Provost under5* sponsorship from Axiado.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND17* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE18* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE19* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE20* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL21* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS22* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)23* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT24* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY25* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF26* SUCH DAMAGE.27*/2829#include <sys/types.h>30#include <ieeefp.h>3132/**33* RISC-V doesn't support floating-point exceptions: RISC-V Instruction Set34* Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status35* Register: "As allowed by the standard, we do not support traps on36* floating-point exceptions in the base ISA, but instead require explicit37* checks of the flags in software. We considered adding branches controlled38* directly by the contents of the floating-point accrued exception flags, but39* ultimately chose to omit these instructions to keep the ISA simple."40*41* We still need this function, because some applications (notably Perl) call42* it, but we cannot provide a meaningful implementation.43**/44fp_except_t45fpsetmask(fp_except_t mask)46{4748return (0);49}505152