From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13740 invoked by alias); 27 Aug 2003 20:44:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13728 invoked by uid 48); 27 Aug 2003 20:44:26 -0000 Date: Wed, 27 Aug 2003 20:44:00 -0000 From: "yuri at tsoft dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20030827204425.12083.yuri@tsoft.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/12083] New: [IMPROVEMENT PROPOSITION] To have builtin function comparing memory backwards X-Bugzilla-Reason: CC X-SW-Source: 2003-08/txt/msg03090.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12083 Summary: [IMPROVEMENT PROPOSITION] To have builtin function comparing memory backwards Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yuri at tsoft dot com CC: gcc-bugs at gcc dot gnu dot org Right now if code has function "memcmp" compiler will inline/optimize it into "cld; repz cmpsb" - type of code inassembly on i386. But if the problem is to compare backwards, assembly still can do it efficiently just replacing cld with std and moving pointers to the end of block. But from C this efficiency is unavailable. I propose to add GCC-extention: add builtin function "gcc_rmemcmp" which will compare memory in reverse direction. Yuri (yuri at tsoft dot com). PS: I will try to work on such patch myself once I have time.