From patchwork Thu Dec 24 11:21:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandra Tsvetkova X-Patchwork-Id: 560881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D4D90140320 for ; Thu, 24 Dec 2015 22:21:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=S6xLKPi1; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=md96lNm3rN9CfeKludZJIuUF154ZTJFqzEmDyPi3hF1f4q ipP9AD+a+I93Y3nTvLOWciJSXAzJacat4kSvo+JjdcCwy3B1xbtydxUqNQkCYBOy /MQmFRSL0bcS4Q5TQvLPEkRHuXpn9cEMMVkzVTpKvD3yq8AjogYvnRCzjGRco= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=DDYWcEILYmhWRXy2b/BUaBIETrk=; b=S6xLKPi1C3K1+eoHGQEc ui6QtvK6ZB5Eh7JHA+8zx8aYX8BybcplmYS9WegggRUDPjkfX0pAz390ARzMXQyV RxwHgbHblv2mw6gVB2DpWL2ggTacm+Wq/9TOHthjeNolCBnwM1nplOW1znI5IyaC FsvY2tVf0jnsSwQcO/rDM5g= Received: (qmail 40279 invoked by alias); 24 Dec 2015 11:21:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 40253 invoked by uid 89); 24 Dec 2015 11:21:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_40, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=dst, void**, alexandra, Alexandra X-HELO: mail-lb0-f180.google.com Received: from mail-lb0-f180.google.com (HELO mail-lb0-f180.google.com) (209.85.217.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 24 Dec 2015 11:21:47 +0000 Received: by mail-lb0-f180.google.com with SMTP id sv6so52336080lbb.0 for ; Thu, 24 Dec 2015 03:21:46 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.202.101 with SMTP id kh5mr12163947lbc.66.1450956103631; Thu, 24 Dec 2015 03:21:43 -0800 (PST) Received: by 10.25.81.204 with HTTP; Thu, 24 Dec 2015 03:21:43 -0800 (PST) Date: Thu, 24 Dec 2015 14:21:43 +0300 Message-ID: Subject: [PATCH] Performance fix for libmpx memmove wrapper From: Aleksandra Tsvetkova To: gcc-patches This patch was tested on spec2000, spec2006 and make check. It fixes regression on vortex. 2015-12-11 Tsvetkova Alexandra * libmpxwrap/mpx_wrappers.c (mpx_pointer): New type. return dst; diff --git a/libmpx/mpxwrap/mpx_wrappers.c b/libmpx/mpxwrap/mpx_wrappers.c old mode 100644 new mode 100755 index ffa7e7e..679e546 --- a/libmpx/mpxwrap/mpx_wrappers.c +++ b/libmpx/mpxwrap/mpx_wrappers.c @@ -483,10 +483,20 @@ __mpx_wrapper_memmove (void *dst, const void *src, size_t n) __bnd_chk_ptr_bounds (dst, n); __bnd_chk_ptr_bounds (src, n); + /* This is an speedup for size of pointer. */ + if (n == sizeof (void *)) + { + const void **s = (const void**)src; + void **d = (void**)dst; + *d = *s; + return dst; + } + memmove (dst, src, n); + /* Not necessary to copy bounds if size is less then size of pointer or SRC==DST. */ - if ((n >= sizeof (void *)) && (src != dst)) + if ((n > sizeof (void *)) && (src != dst)) move_bounds (dst, src, n);