Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp708339pxm; Fri, 25 Feb 2022 17:54:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKpP9QfmP+5wP4IQhwkYX2U2i+NfoNUXjy1Fv2dnp9mhSPxuwAXdJkEuMZSW7eBxbCT0YD X-Received: by 2002:a17:90b:4ac7:b0:1bc:fd05:6ea0 with SMTP id mh7-20020a17090b4ac700b001bcfd056ea0mr4111817pjb.75.1645840490912; Fri, 25 Feb 2022 17:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645840490; cv=none; d=google.com; s=arc-20160816; b=ERKlkmY9SPrg3hnaGzcb3MjmYBLieZFUhLS1ppKeXmX2U7sflndJb78HNOWzOJRC+J OdvOUxyW9z1H1/HH9+2Y614wxa+id5ys/ChBxWBZOX/q5cCYvZJ/54MBQrFAh5oPDo8V 8G1jXPMJmDqZIa9XF85kp4xDKFmVXgwFmIcWPWuCiTKxV7KtkhKnG8kO52q3/RPxOWsB 4eHT8fJaPR8hxFXPCOhBUHMz6PX/jvyIguXPZ/GtW9CVY72CXiOTvjHuKtIlvJIr3b1V M8e/sZhU2qZ85XlEEsZAlP2dBe0SOo5YekU6VlmoD6N9n6k/Rh52kOlZocDEUI1j4wih G4NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=iHR+Oyb1ezUo+KBJrr8gkpI0ZOna3NjyGROc+2pSeKk=; b=L8OEmIfvP45vSUnle673T+IgzyJBMCsU1zkOw1L7aaK4S4WxfFy9vhyWVfePeAFfUI rmBfm1LCd8y/UuISd9qcuVpKKy+7RSCflTSjRSRV4yZnvoM9wWoXpIFN1lDH5WFqu27b Q1CYK40gyEY67l5l4407lEKXgduq6hNq0i1Ozs2zqmw/Z62UR3GRgC4B80sDP0mvI8VR 1M5cGRdbd4HCRkJMBY6N8EGnwdeRQckk/UwabbmTxlaQbVg787r1KJ18L2JlolmwRtdE 2mgSaEbTUh9wNUWS9iDQHVoz4IYVhQZ+AvjiLg74nMJ+fFo9ciq3o2JSAAeZe5+TmwCD eBRg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d198-20020a6336cf000000b00373a7013727si3294060pga.747.2022.02.25.17.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:54:50 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19DDE26D5D7; Fri, 25 Feb 2022 17:38:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbiBYVvf convert rfc822-to-8bit (ORCPT + 99 others); Fri, 25 Feb 2022 16:51:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbiBYVv3 (ORCPT ); Fri, 25 Feb 2022 16:51:29 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E36672118E4 for ; Fri, 25 Feb 2022 13:50:55 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-112-w1ITZkChPlS7OAK-8FapSw-1; Fri, 25 Feb 2022 21:50:53 +0000 X-MC-Unique: w1ITZkChPlS7OAK-8FapSw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Fri, 25 Feb 2022 21:50:51 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.028; Fri, 25 Feb 2022 21:50:51 +0000 From: David Laight To: 'Michal Simek' , "linux-kernel@vger.kernel.org" , "monstr@monstr.eu" , "git@xilinx.com" CC: Mahesh Bodapati , Randy Dunlap Subject: RE: [PATCH v2 2/3] microblaze: Do loop unrolling for optimized memset implementation Thread-Topic: [PATCH v2 2/3] microblaze: Do loop unrolling for optimized memset implementation Thread-Index: AQHYKk9znCG7mUdB/U+6GgVbIJ8zwqykzU1g Date: Fri, 25 Feb 2022 21:50:50 +0000 Message-ID: References: <10a432e269a6d3349cf458e4f5792522779cba0d.1645797329.git.michal.simek@xilinx.com> In-Reply-To: <10a432e269a6d3349cf458e4f5792522779cba0d.1645797329.git.michal.simek@xilinx.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Simek > Sent: 25 February 2022 13:56 > > Align implementation with memcpy and memmove where also remaining bytes are > copied via final switch case instead of using simple implementations which > loop. But this alignment has much stronger reason and definitely aligning > implementation is not the key point here. It is just good to have in mind > that the same technique is used already there. > > In GCC 10, now -ftree-loop-distribute-patterns optimization is on at O2. > This optimization causes GCC to convert the while loop in memset.c into a > call to memset. Gah... That is nearly as brain dead as another compiler that would convert any byte copy loop (on x86) into 'rep movsb'. If I want to call memcpy() I'll call memcpy. If I'm copying a few bytes I might write the loop to avoid the cost of the call and all the conditional tests for buffer length and alignment. Don't the compiler writers have better things to do? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)