This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
mips n64 ioctl micro-optimization
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: 20 Mar 2003 03:51:53 -0300
- Subject: mips n64 ioctl micro-optimization
- Organization: GCC Team, Red Hat
I learned yesterday that there's a more efficient way to do
sign-extension from 32 to 64 bits in mips. This patch brings the
improvement to the newly-added ioctl syscall wrapper. Ok?
Index: ChangeLog
from Alexandre Oliva <aoliva at redhat dot com>
* sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S: Sign-extend
with a single instruction.
Index: sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S,v
retrieving revision 1.1
diff -u -p -r1.1 ioctl.S
--- sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S 17 Mar 2003 16:20:44 -0000 1.1
+++ sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S 20 Mar 2003 00:33:38 -0000
@@ -26,8 +26,7 @@
.text
ENTRY (__ioctl)
li v0, __NR_ioctl
- dsll a1,a1,32
- dsra a1,a1,32
+ sll a1,a1,0
syscall /* Do the system call. */
bne a3, zero, L(error)
ret
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer