From 880dfc56113752612c71268e63cbcd3afe860f64 Mon Sep 17 00:00:00 2001 From: kettenis Date: Wed, 28 Apr 2021 08:22:56 +0000 Subject: [PATCH] RISC-V does not implement trapping of floating point exceptions, so use the same dummy fpgetmask(3) and fpsetmask(3) implementation as arm64. ok drahn@ --- lib/libc/arch/riscv64/gen/fpgetmask.c | 26 ++++++++++++++++++++++++++ lib/libc/arch/riscv64/gen/fpsetmask.c | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 lib/libc/arch/riscv64/gen/fpgetmask.c create mode 100644 lib/libc/arch/riscv64/gen/fpsetmask.c diff --git a/lib/libc/arch/riscv64/gen/fpgetmask.c b/lib/libc/arch/riscv64/gen/fpgetmask.c new file mode 100644 index 00000000000..6e94f99bd33 --- /dev/null +++ b/lib/libc/arch/riscv64/gen/fpgetmask.c @@ -0,0 +1,26 @@ +/* $OpenBSD: fpgetmask.c,v 1.1 2021/04/28 08:22:56 kettenis Exp $ */ +/* + * Copyright (c) 2018 Mark Kettenis + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +__weak_alias(_fpgetmask,fpgetmask); + +fp_except +fpgetmask(void) +{ + return 0; +} diff --git a/lib/libc/arch/riscv64/gen/fpsetmask.c b/lib/libc/arch/riscv64/gen/fpsetmask.c new file mode 100644 index 00000000000..03485db6c93 --- /dev/null +++ b/lib/libc/arch/riscv64/gen/fpsetmask.c @@ -0,0 +1,26 @@ +/* $OpenBSD: fpsetmask.c,v 1.1 2021/04/28 08:22:56 kettenis Exp $ */ +/* + * Copyright (c) 2018 Mark Kettenis + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +__weak_alias(_fpsetmask,fpsetmask); + +fp_except +fpsetmask(fp_except mask) +{ + return 0; +} -- 2.20.1