CVS commit: src/lib/libc/arch/sh3/gen

2017-03-10 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat Mar 11 01:25:04 UTC 2017

Modified Files:
src/lib/libc/arch/sh3/gen: flt_rounds.c

Log Message:
fix the mapping table.  this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sh3/gen/flt_rounds.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/sh3/gen

2017-03-10 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat Mar 11 01:25:04 UTC 2017

Modified Files:
src/lib/libc/arch/sh3/gen: flt_rounds.c

Log Message:
fix the mapping table.  this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sh3/gen/flt_rounds.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/sh3/gen/flt_rounds.c
diff -u src/lib/libc/arch/sh3/gen/flt_rounds.c:1.6 src/lib/libc/arch/sh3/gen/flt_rounds.c:1.7
--- src/lib/libc/arch/sh3/gen/flt_rounds.c:1.6	Thu Mar 19 21:22:59 2015
+++ src/lib/libc/arch/sh3/gen/flt_rounds.c	Sat Mar 11 01:25:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.6 2015/03/19 21:22:59 joerg Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.7 2017/03/11 01:25:04 chs Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -33,7 +33,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: flt_rounds.c,v 1.6 2015/03/19 21:22:59 joerg Exp $");
+__RCSID("$NetBSD: flt_rounds.c,v 1.7 2017/03/11 01:25:04 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -42,8 +42,8 @@ __RCSID("$NetBSD: flt_rounds.c,v 1.6 201
 
 static const int map[] = {
 	1,	/* round to nearest */
-	2,	/* round to positive infinity */
-	3,	/* round to negative infinity */
+	3,	/* round to positive infinity */
+	2,	/* round to negative infinity */
 	0	/* round to zero */
 };
 



CVS commit: src/lib/libc/arch/sh3/gen

2015-04-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr  6 01:50:47 UTC 2015

Modified Files:
src/lib/libc/arch/sh3/gen: swapcontext.S

Log Message:
On swapcontext(3) preserve r12 too.  Properly fixes PR port-sh3/49597.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/sh3/gen/swapcontext.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/sh3/gen/swapcontext.S
diff -u src/lib/libc/arch/sh3/gen/swapcontext.S:1.11 src/lib/libc/arch/sh3/gen/swapcontext.S:1.12
--- src/lib/libc/arch/sh3/gen/swapcontext.S:1.11	Sun Jan 25 01:32:26 2015
+++ src/lib/libc/arch/sh3/gen/swapcontext.S	Mon Apr  6 01:50:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.12 2015/04/06 01:50:46 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $)
+	RCSID($NetBSD: swapcontext.S,v 1.12 2015/04/06 01:50:46 uwe Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 /*
@@ -40,44 +40,33 @@
  */
 ENTRY(swapcontext)
 	PIC_PROLOGUE(.L_got)
-	mov.l	r5, @-sp
 	sts.l	pr, @-sp
 
 	mov.l	.L__getcontext, r0
-1:	CALL	r0			/* _getcontext(oucp) */
+	mov.l	r5, @-sp
+1:	CALL	r0			! _getcontext(oucp)
 	 mov.l	r4, @-sp
-	mov.l	@sp+, r1
+	!! getcontext captures oucp resuming here with r12 (when PIC),
+	!! pr, r5 and r4 pushed onto the stack
+
 	tst	r0, r0
-	bf	3f			/* return error from getcontext */
+	bf.s	3f			! return error from getcontext
+	 mov.l	@sp, r1			! saved oucp
 
-	/* Note: getcontext does _UC_MACHINE_INTRV(oucp) = 0 for us */
-	mov.l	@sp, r0
-	mov.l	r0, @(36 + 1 * 4, r1)	/* _UC_MACHINE_SET_PC(oucp, pr) */
-
-	/* Adjust stack pointer in oucp */
-	mov	sp, r2
-	mov	#(36 + 21 * 4), r0	/* offset to _UC_MACHINE_SP */
-#ifdef __PIC__
-	add	#12, r2			/* drop r12, r5, pr */
-#else
-	add	#8, r2			/* drop r5, pr */
-#endif
-	mov.l	r2, @(r0, r1)		/* set _UC_MACHINE_SP(oucp) */
+	!! adjust oucp to resume after setcontext below
+	mova	3f, r0
+	mov.l	r0, @(36 + 1 * 4, r1)	! _UC_MACHINE_SET_PC(oucp, pr)
 
 	mov.l	.L_setcontext, r2
-2:	CALL	r2			/* setcontext(ucp) */
-	 mov.l	@(4, sp), r4
-	/* if we get here, return error from setcontext */
-3:
+2:	CALL	r2			! setcontext(ucp)
+	 mov.l	@(4, sp), r4		! saved ucp
+
+	.align	2
+3:	!! we get here on errors and when resuming oucp
+	add	#8, sp			! skip r4 and r5
 	lds.l	@sp+, pr
-#ifdef __PIC__
-	add	#4, sp
-	rts
-	 PIC_EPILOGUE
-#else
 	rts
-	 add	#4, sp
-#endif
+	 PIC_EPILOGUE_SLOT
 
 	.align	2
 .L_got:			PIC_GOT_DATUM



CVS commit: src/lib/libc/arch/sh3/gen

2015-04-05 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Apr  6 01:50:47 UTC 2015

Modified Files:
src/lib/libc/arch/sh3/gen: swapcontext.S

Log Message:
On swapcontext(3) preserve r12 too.  Properly fixes PR port-sh3/49597.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/sh3/gen/swapcontext.S

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/sh3/gen

2015-01-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 25 01:32:26 UTC 2015

Modified Files:
src/lib/libc/arch/sh3/gen: swapcontext.S

Log Message:
Adjust _UC_MACHINE_SP(oucp) to drop values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.

From Yasushi Oshima in PR port-sh3/49597


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/sh3/gen/swapcontext.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/sh3/gen/swapcontext.S
diff -u src/lib/libc/arch/sh3/gen/swapcontext.S:1.10 src/lib/libc/arch/sh3/gen/swapcontext.S:1.11
--- src/lib/libc/arch/sh3/gen/swapcontext.S:1.10	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/sh3/gen/swapcontext.S	Sun Jan 25 01:32:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.10 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: swapcontext.S,v 1.10 2013/09/12 15:36:15 joerg Exp $)
+	RCSID($NetBSD: swapcontext.S,v 1.11 2015/01/25 01:32:26 uwe Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 /*
@@ -53,6 +53,17 @@ ENTRY(swapcontext)
 	/* Note: getcontext does _UC_MACHINE_INTRV(oucp) = 0 for us */
 	mov.l	@sp, r0
 	mov.l	r0, @(36 + 1 * 4, r1)	/* _UC_MACHINE_SET_PC(oucp, pr) */
+
+	/* Adjust stack pointer in oucp */
+	mov	sp, r2
+	mov	#(36 + 21 * 4), r0	/* offset to _UC_MACHINE_SP */
+#ifdef __PIC__
+	add	#12, r2			/* drop r12, r5, pr */
+#else
+	add	#8, r2			/* drop r5, pr */
+#endif
+	mov.l	r2, @(r0, r1)		/* set _UC_MACHINE_SP(oucp) */
+
 	mov.l	.L_setcontext, r2
 2:	CALL	r2			/* setcontext(ucp) */
 	 mov.l	@(4, sp), r4



CVS commit: src/lib/libc/arch/sh3/gen

2015-01-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 25 01:32:26 UTC 2015

Modified Files:
src/lib/libc/arch/sh3/gen: swapcontext.S

Log Message:
Adjust _UC_MACHINE_SP(oucp) to drop values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.

From Yasushi Oshima in PR port-sh3/49597


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/sh3/gen/swapcontext.S

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/sh3/gen

2014-01-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jan 20 17:14:38 UTC 2014

Modified Files:
src/lib/libc/arch/sh3/gen: Makefile.inc
Removed Files:
src/lib/libc/arch/sh3/gen: fabs.c

Log Message:
Use fabs_ieee754.c.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/arch/sh3/gen/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/lib/libc/arch/sh3/gen/fabs.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/sh3/gen/Makefile.inc
diff -u src/lib/libc/arch/sh3/gen/Makefile.inc:1.25 src/lib/libc/arch/sh3/gen/Makefile.inc:1.26
--- src/lib/libc/arch/sh3/gen/Makefile.inc:1.25	Sun Dec  6 07:12:17 2009
+++ src/lib/libc/arch/sh3/gen/Makefile.inc	Mon Jan 20 17:14:38 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.25 2009/12/06 07:12:17 uebayasi Exp $
+#	$NetBSD: Makefile.inc,v 1.26 2014/01/20 17:14:38 joerg Exp $
 
 SRCS+=	setjmp.S _setjmp.S sigsetjmp.S
 
@@ -6,7 +6,7 @@ SRCS+=	makecontext.c resumecontext.c swa
 
 SRCS+=	_lwp.c
 
-SRCS+=	fabs.c flt_rounds.c bswap16.c bswap32.c bswap64.c
+SRCS+=	fabs_ieee754.c flt_rounds.c bswap16.c bswap32.c bswap64.c
 
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c



CVS commit: src/lib/libc/arch/sh3/gen

2014-01-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jan 20 17:14:38 UTC 2014

Modified Files:
src/lib/libc/arch/sh3/gen: Makefile.inc
Removed Files:
src/lib/libc/arch/sh3/gen: fabs.c

Log Message:
Use fabs_ieee754.c.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/arch/sh3/gen/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/lib/libc/arch/sh3/gen/fabs.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/sh3/gen

2012-03-22 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Mar 22 08:58:39 UTC 2012

Modified Files:
src/lib/libc/arch/sh3/gen: flt_rounds.c

Log Message:
Add a void to make function declaration c89.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sh3/gen/flt_rounds.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/sh3/gen/flt_rounds.c
diff -u src/lib/libc/arch/sh3/gen/flt_rounds.c:1.4 src/lib/libc/arch/sh3/gen/flt_rounds.c:1.5
--- src/lib/libc/arch/sh3/gen/flt_rounds.c:1.4	Wed Jan 17 23:24:22 2007
+++ src/lib/libc/arch/sh3/gen/flt_rounds.c	Thu Mar 22 08:58:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.4 2007/01/17 23:24:22 hubertf Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.5 2012/03/22 08:58:39 he Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -33,7 +33,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: flt_rounds.c,v 1.4 2007/01/17 23:24:22 hubertf Exp $);
+__RCSID($NetBSD: flt_rounds.c,v 1.5 2012/03/22 08:58:39 he Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include sys/types.h
@@ -75,7 +75,7 @@ static const int map[] = {
 extern int __flt_rounds __P((void));
 
 int
-__flt_rounds()
+__flt_rounds(void)
 {
 	return(map[fpgetround()]);
 }



CVS commit: src/lib/libc/arch/sh3/gen

2012-03-22 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Mar 22 08:58:39 UTC 2012

Modified Files:
src/lib/libc/arch/sh3/gen: flt_rounds.c

Log Message:
Add a void to make function declaration c89.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sh3/gen/flt_rounds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.