This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] aarch64: Optimized implementation of memcmp
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Xuelei Zhang <zhangxuelei4 at huawei dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "siddhesh at gotplt dot org" <siddhesh at gotplt dot org>, Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>, "jiangyikun at huawei dot com" <jiangyikun at huawei dot com>, "yikunkero at gmail dot com" <yikunkero at gmail dot com>
- Cc: nd <nd at arm dot com>
- Date: Thu, 24 Oct 2019 16:33:58 +0000
- Subject: Re: [PATCH v3] aarch64: Optimized implementation of memcmp
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C1dMJXwyEHqZ4cX7w04VVCDCp/jKR2nOrqzho5AW3b4=; b=Y2whkcodmnoH9hsg7UZENcrFww1wgKttMAmOkjuHu7iyQHwslVNXWYUQpQd+6DtJsoZP8FXNDoS9wCFlxJfsgyZb4yLROW9BdAZg8MgpUo30AhRmPRL+e5Sbm/IGBPN14JdbLA1D/SzNMDNNOLLoeyO1s76vZ2xT+5IGAsf10Aff86UwjdWg4INafwSJK+3wHJBDBBlqeysGDgoG2UjcPj0rlXKtUxqu+W7QcKRsAFX4wriJ2S00m0B7ct96vR8c2C1GpqrSJ5mUJVZlD08XrnalgRWlveG0DsCCognCHP9/k4bnSJqScCYTVCjo/gzUaTtp1pcDHPDCVIJOUKV/wg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ttvi2QFWc8K3hMPrItIfW+jvyIKFeRIV0VLwR2OsjQkbLLGb+aGM9P3PNt5mfkOTk3oS0fdO4qN0yo3SKCUFG16W9qoMWQeNMT4saXBQo8vvaynN9uC+txv13IyfEzdKCdVvKNtV4ymLprhDmZFTLheNlHaZeBZXHpveHItd5XcZAaC+QIwKl7nJ95nJtI+G+joISDGs0VMNgJYsgiW3KoQ/Ql+k1V7j7RDabqB0PKtabUDIV7cMJG6ht+6E3TLq62Je8auknNaY/Yq+P6utZKvL6Q7c3Fqq8XN30hmGzqtGpUpzax+DO6P4rChL7l1wE9uzL2K2PEfthoQyz98hWw==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- References: <20191023140424.17880-1-zhangxuelei4@huawei.com>
Hi Xuelei,
> The loop body is expanded from a 16-byte comparison to a 64-byte
> comparison, and the usage of ldp is replaced by the Post-index
> mode to the Base plus offset mode. Hence, compare can faster 18%
> around > 128 bytes in all.
>> So why not use 2xCSEL rather than a branch across the moves?
>> That's going to be faster since the branch will be hard to predict.
>
> Great! This can reduce one branch prediction, and I have modified as suggested.
>
> Other problems like unused label and format is also corrected.
Thanks, this version looks good. OK to commit.
Wilco