about summary refs log tree commit diff
path: root/sysdeps/alpha/div_libc.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-05-06 22:01:01 +0000
committerRichard Henderson <rth@redhat.com>2004-05-06 22:01:01 +0000
commit165634aa4c7ed7b2fe8a47ff24166400a419d141 (patch)
tree769e3eb211ade1b2dce18d6dcb745b293b8f7aef /sysdeps/alpha/div_libc.h
parent58d87ee17185dbd0b8f927c939343eaed34c8614 (diff)
downloadglibc-165634aa4c7ed7b2fe8a47ff24166400a419d141.tar.gz
glibc-165634aa4c7ed7b2fe8a47ff24166400a419d141.tar.xz
glibc-165634aa4c7ed7b2fe8a47ff24166400a419d141.zip
* sysdeps/alpha/div_libc.h (_ITOFS, _ITOFT, _FTOIT, _ITOFT2): New. * sysdeps/alpha/divl.S, sysdeps/alpha/divq.S, sysdeps/alpha/divqu.S, sysdeps/alpha/reml.S, sysdeps/alpha/remq.S, sysdeps/alpha/remqu.S: Use them.
2004-05-06  Richard Henderson  <rth@redhat.com>

	* sysdeps/alpha/div_libc.h (_ITOFS, _ITOFT, _FTOIT, _ITOFT2): New.
	* sysdeps/alpha/divl.S, sysdeps/alpha/divq.S, sysdeps/alpha/divqu.S,
	sysdeps/alpha/reml.S, sysdeps/alpha/remq.S, sysdeps/alpha/remqu.S:
	Use them.
Diffstat (limited to 'sysdeps/alpha/div_libc.h')
-rw-r--r--sysdeps/alpha/div_libc.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/sysdeps/alpha/div_libc.h b/sysdeps/alpha/div_libc.h
index 98566435ce..27209bd9fa 100644
--- a/sysdeps/alpha/div_libc.h
+++ b/sysdeps/alpha/div_libc.h
@@ -111,3 +111,48 @@ DIVBYZERO:
 	cfi_endproc
 	.size	DIVBYZERO, .-DIVBYZERO
 .endm
+
+/* Like the ev6 instructions, but fall back to stack use on prior machines.  */
+
+	.arch	ev6
+
+.macro _ITOFS  gr, fr, slot
+#ifdef __alpha_fix__
+	itofs	\gr, \fr
+#else
+	stl	\gr, \slot($sp)
+	lds	\fr, \slot($sp)
+#endif
+.endm
+
+.macro _ITOFT  gr, fr, slot
+#ifdef __alpha_fix__
+	itoft	\gr, \fr
+#else
+	stq	\gr, \slot($sp)
+	ldt	\fr, \slot($sp)
+#endif
+.endm
+
+.macro _FTOIT  fr, gr, slot
+#ifdef __alpha_fix__
+	ftoit	\fr, \gr
+#else
+	stt	\fr, \slot($sp)
+	ldq	\gr, \slot($sp)
+#endif
+.endm
+
+/* Similarly, but move two registers.  Schedules better for pre-ev6.  */
+
+.macro _ITOFT2 gr1, fr1, slot1, gr2, fr2, slot2
+#ifdef __alpha_fix__
+	itoft	\gr1, \fr1
+	itoft	\gr2, \fr2
+#else
+	stq	\gr1, \slot1($sp)
+	stq	\gr2, \slot2($sp)
+	ldt	\fr1, \slot1($sp)
+	ldt	\fr2, \slot2($sp)
+#endif
+.endm