This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips n64 ioctl micro-optimization

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 @@
 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)
Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                 aoliva at {redhat dot com,}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot br,}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]