Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262204AbVDFNVg (ORCPT ); Wed, 6 Apr 2005 09:21:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262206AbVDFNVf (ORCPT ); Wed, 6 Apr 2005 09:21:35 -0400 Received: from alog0690.analogic.com ([208.224.223.227]:57311 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id S262204AbVDFNUP (ORCPT ); Wed, 6 Apr 2005 09:20:15 -0400 Date: Wed, 6 Apr 2005 09:18:16 -0400 (EDT) From: "Richard B. Johnson" Reply-To: linux-os@analogic.com To: Dave Korn cc: Denis Vlasenko , Christophe Saout , Andrew Morton , Jan Hubicka , Gerold Jury , jakub@redhat.com, Linux Kernel Mailing List , gcc@gcc.gnu.org Subject: RE: [BUG mm] "fixed" i386 memcpy inlining buggy In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1879706418-1382007614-1112793496=:22100" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4015 Lines: 101 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1879706418-1382007614-1112793496=:22100 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Attached is inline ix86 memcpy() plus test code that tests its corner-cases. The in-line code makes no jumps, but uses longword copies, word copies and any spare byte copy. It works at all offsets, doesn't require alignment but would work fastest if both source and destination were longword aligned. On Wed, 6 Apr 2005, Dave Korn wrote: > ----Original Message---- >> From: Dave Korn >> Sent: 06 April 2005 12:13 > >> ----Original Message---- >>> From: Dave Korn >>> Sent: 06 April 2005 12:06 >> >> >> Me and my big mouth. >> >> OK, that one does work. >> >> Sorry for the outburst. >> > > > .... well, actually, maybe it doesn't after all. > > > What's that uninitialised variable ecx doing there eh? > > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > Cheers, Dick Johnson Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips). Notice : All mail here is now cached for review by Dictator Bush. 98.36% of all statistics are fiction. --1879706418-1382007614-1112793496=:22100 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="memcpy.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="memcpy.c" DQojaW5jbHVkZSA8c3RkaW8uaD4NCiNpbmNsdWRlIDxzdHJpbmcuaD4NCg0K DQovLw0KLy8gIElubGluZSBpeDg2IG1lbWNweSgpIHRoYXQgY29udGFpbnMg bm8ganVtcHMuIE5vdCBjb3BpZWQgZnJvbQ0KLy8gIGFueWJvZHkuCUNvbnRy aWJ1dGVkIGJ5IHJqb2huc29uQGFuYWxvZ2ljLmNvbQ0KLy8NCg0Kc3RhdGlj IF9faW5saW5lX18gdm9pZCAqbWVtY3B5KHZvaWQgKmRzdCwgdm9pZCAqc3Jj LCBzaXplX3QgbGVuKSB7DQogICAgICAgIHZvaWQgKnJldCA9IGRzdDsNCiAg ICAgICAgX19hc21fXyBfX3ZvbGF0aWxlX18oCVwNCgkiY2xkXG4iCQkJXA0K CSJzaHIgJDEsICUlZWN4XG4iCVwNCgkicHVzaGZcbiIJCVwNCgkic2hyICQx LCAlJWVjeFxuIglcDQoJInB1c2hmXG4iCQlcDQoJInJlcFxuIgkJCVwNCgki bW92c2xcbiIJCVwNCgkicG9wZlxuIgkJXA0KCSJhZGNsICUlZWN4LCAlJWVj eFxuIglcDQoJInJlcFxuIgkJCVwNCgkibW92c3dcbiIJCVwNCgkicG9wZlxu IgkJXA0KCSJhZGNsICUlZWN4LCAlJWVjeFxuIglcDQoJInJlcFxuIgkJCVwN CgkibW92c2JcbiIJCVwNCgk6ICI9RCIgKGRzdCksICI9UyIgKHNyYyksICI9 YyIobGVuKQ0KCTogIjAiICAoZHN0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uIDA7DQp9DQo= --1879706418-1382007614-1112793496=:22100-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/