CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: rillig Date: Wed Mar 20 06:15:40 UTC 2024 Modified Files: src/lib/libc/arch/sparc64/gen: fpsetround.c Log Message: sparc64/fpsetround: avoid shifting into the sign bit Lint had warned about the constant expression '0x03 << 30' but not about the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/sparc64/gen/fpsetround.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/sparc64/gen/fpsetround.c diff -u src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8 src/lib/libc/arch/sparc64/gen/fpsetround.c:1.9 --- src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8 Mon Mar 11 23:05:35 2024 +++ src/lib/libc/arch/sparc64/gen/fpsetround.c Wed Mar 20 06:15:39 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $ */ +/* $NetBSD: fpsetround.c,v 1.9 2024/03/20 06:15:39 rillig Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $"); +__RCSID("$NetBSD: fpsetround.c,v 1.9 2024/03/20 06:15:39 rillig Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -36,8 +36,8 @@ fpsetround(fp_rnd rnd_dir) #endif new = old; - new &= ~(0x03U << 30); - new |= ((rnd_dir & 0x03) << 30); + new &= ~(0x03U << 30); + new |= ((rnd_dir & 0x03U) << 30); __asm("ld %0,%%fsr" : : "m" (*));
CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: rillig Date: Wed Mar 20 06:15:40 UTC 2024 Modified Files: src/lib/libc/arch/sparc64/gen: fpsetround.c Log Message: sparc64/fpsetround: avoid shifting into the sign bit Lint had warned about the constant expression '0x03 << 30' but not about the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/sparc64/gen/fpsetround.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: christos Date: Mon Mar 11 23:05:35 UTC 2024 Modified Files: src/lib/libc/arch/sparc64/gen: fpsetround.c Log Message: fix lint To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sparc64/gen/fpsetround.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: christos Date: Mon Mar 11 23:05:35 UTC 2024 Modified Files: src/lib/libc/arch/sparc64/gen: fpsetround.c Log Message: fix lint To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sparc64/gen/fpsetround.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/sparc64/gen/fpsetround.c diff -u src/lib/libc/arch/sparc64/gen/fpsetround.c:1.7 src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8 --- src/lib/libc/arch/sparc64/gen/fpsetround.c:1.7 Sun Oct 27 21:06:36 2013 +++ src/lib/libc/arch/sparc64/gen/fpsetround.c Mon Mar 11 19:05:35 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetround.c,v 1.7 2013/10/28 01:06:36 mrg Exp $ */ +/* $NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 @@ -7,7 +7,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpsetround.c,v 1.7 2013/10/28 01:06:36 mrg Exp $"); +__RCSID("$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -19,14 +19,15 @@ __RCSID("$NetBSD: fpsetround.c,v 1.7 201 __weak_alias(fpsetround,_fpsetround) #endif +#ifdef SOFTFLOATSPARC64_FOR_GCC +extern fp_rnd _softfloat_float_rounding_mode; +#endif + fp_rnd fpsetround(fp_rnd rnd_dir) { fp_rnd old; fp_rnd new; -#ifdef SOFTFLOATSPARC64_FOR_GCC - extern fp_rnd _softfloat_float_rounding_mode; -#endif __asm("st %%fsr,%0" : "=m" (*)); @@ -35,7 +36,7 @@ fpsetround(fp_rnd rnd_dir) #endif new = old; - new &= ~(0x03 << 30); + new &= ~(0x03U << 30); new |= ((rnd_dir & 0x03) << 30); __asm("ld %0,%%fsr" : : "m" (*));
CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: skrll Date: Wed Oct 11 06:16:13 UTC 2023 Modified Files: src/lib/libc/arch/sparc64/gen: setjmp.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/sparc64/gen/setjmp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/sparc64/gen/setjmp.S diff -u src/lib/libc/arch/sparc64/gen/setjmp.S:1.10 src/lib/libc/arch/sparc64/gen/setjmp.S:1.11 --- src/lib/libc/arch/sparc64/gen/setjmp.S:1.10 Thu Sep 12 15:36:16 2013 +++ src/lib/libc/arch/sparc64/gen/setjmp.S Wed Oct 11 06:16:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: setjmp.S,v 1.10 2013/09/12 15:36:16 joerg Exp $ */ +/* $NetBSD: setjmp.S,v 1.11 2023/10/11 06:16:13 skrll Exp $ */ /* * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 .asciz "@(#)setjmp.s 8.1 (Berkeley) 6/4/93" #else - RCSID("$NetBSD: setjmp.S,v 1.10 2013/09/12 15:36:16 joerg Exp $") + RCSID("$NetBSD: setjmp.S,v 1.11 2023/10/11 06:16:13 skrll Exp $") #endif #endif /* LIBC_SCCS and not lint */ @@ -107,7 +107,7 @@ ENTRY(__setjmp14) call _C_LABEL(__sigaltstack14) #endif add %i0, 8, %o1 /* (foo being part of the sigcontext we're overwriting) */ - + lduw [%i0 + 8 + 0x10], %o0 /* foo.ss_flags */ and %o0, 1, %o1 /* onstack = foo.ss_flags & SS_ONSTACK; */ st %o1, [%i0 + 0x00] /* sc.sc_onstack = current onstack; */
CVS commit: src/lib/libc/arch/sparc64/gen
Module Name:src Committed By: skrll Date: Wed Oct 11 06:16:13 UTC 2023 Modified Files: src/lib/libc/arch/sparc64/gen: setjmp.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/sparc64/gen/setjmp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.