RFA: V850: Enable FPU on the V850e2v3

Nick Clifton nickc@redhat.com
Tue Jan 15 08:50:00 GMT 2013


Hi Guys,

  Please may I have permission to apply the following patch.  It extends
  the crt0 file for the v850 so that it enables the FPU if the target
  processor is the V850e2v3.

Cheers
  Nick

newlib/ChangeLog
2013-01-15  Nick Clifton  <nickc@redhat.com>

	* libc/sys/sysnecv850/crt0.S (_start): Enable FPU for the
	V850e2v3.

libgloss/ChangeLog
2013-01-15  Nick Clifton  <nickc@redhat.com>

	* v850/crt0.S (_start): Enable FPU for the V850e2v3.

Index: newlib/libc/sys/sysnecv850/crt0.S
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/sysnecv850/crt0.S,v
retrieving revision 1.5
diff -u -3 -p -r1.5 crt0.S
--- newlib/libc/sys/sysnecv850/crt0.S	30 Jul 2012 23:03:47 -0000	1.5
+++ newlib/libc/sys/sysnecv850/crt0.S	15 Jan 2013 08:46:39 -0000
@@ -14,6 +14,18 @@ _start:
 	mov     hilo(__gp),	gp
 	mov     hilo(__ctbp),	r6
 	ldsr    r6,             ctbp
+
+#if defined(__v850e2v3__)
+	// FPU enable
+	stsr    psw,            r6
+	movhi   1,              r0,      r7
+	or      r7,             r6
+	ldsr    r6,             psw
+	// Initialize the FPSR
+	movhi	2,		r0,	r6
+	ldsr    r6, 	    	fpsr
+#endif
+	
 	mov     hilo(_edata),	r6
 	mov     hilo(_end),	r7
 .L0:
Index: libgloss/v850/crt0.S
===================================================================
RCS file: /cvs/src/src/libgloss/v850/crt0.S,v
retrieving revision 1.1
diff -u -3 -p -r1.1 crt0.S
--- libgloss/v850/crt0.S	23 Jul 2010 17:52:37 -0000	1.1
+++ libgloss/v850/crt0.S	15 Jan 2013 08:46:39 -0000
@@ -14,6 +14,16 @@ _start:
 	mov     hilo(__gp),	gp
 	mov     hilo(__ctbp),	r6
 	ldsr    r6,             ctbp
+#if defined(__v850e2v3__)
+	// FPU enable
+	stsr    psw,            r6
+	movhi   1,              r0,      r7
+	or      r7,             r6
+	ldsr    r6,             psw
+	// Initialize the FPSR
+	movhi	2,		r0,	r6
+	ldsr    r6, 	    	fpsr
+#endif
 	mov     hilo(_edata),	r6
 	mov     hilo(_end),	r7
 .L0:



More information about the Newlib mailing list