From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id C9BEC3858CDB for ; Thu, 13 Jul 2023 22:17:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9BEC3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 971E63C011BD4; Thu, 13 Jul 2023 15:17:02 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zxHwYMXLyJNC; Thu, 13 Jul 2023 15:17:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 4F8153C011BD8; Thu, 13 Jul 2023 15:17:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 4F8153C011BD8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1689286622; bh=vJ0932wjwxK/woA4iFWviPprX2+z9iLhDSifFQ5QUz0=; h=Message-ID:Date:MIME-Version:To:From; b=N/aRAN02SZ8C+muUX0u0jX2YbPXxDcti23R5XL7GelW60nPcv60/KI0WT+w0WnePM ZVMYoqzQDI+UwkIoqtX0bTaNAIrkOp3DDopzpNbceTBnKwemmhCXtTNRBSaD8gcful xQ0p9AP4+sYu+aoT2sjrPSjY4KIJYswM0EVbaNuZP0NoOPA/FV4LGXwB0QZaXCKNhH 5brWDFcvW+iBvZQuvPFxm47tzBBmw1UCOwI98rTBc58PEi60lAfGThac+6+2xUS+Ah NPkd9EH1kRWLCyUgFL2X+UXgJLoHdPFIezlZzy2eMVClO3b6CZa4tSHh5wIQ0Wr0fB wlVdw8K3NQGiA== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PzqaP_JTc43o; Thu, 13 Jul 2023 15:17:02 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 2EFF03C011BD4; Thu, 13 Jul 2023 15:17:02 -0700 (PDT) Message-ID: <5b14fe86-97de-9ced-bcb4-0ae9a068e814@cs.ucla.edu> Date: Thu, 13 Jul 2023 15:17:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v5 1/6] stdlib: Optimization qsort{_r} swap implementation Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20230713132540.2854320-1-adhemerval.zanella@linaro.org> <20230713132540.2854320-2-adhemerval.zanella@linaro.org> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: <20230713132540.2854320-2-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-07-13 06:25, Adhemerval Zanella via Libc-alpha wrote: > +is_aligned (const void *base, size_t size, unsigned char align) ALIGN should be of type size_t, not unsigned char. Although this shouldn't change the machine code it's better documentation and more robust to future changes. > + if (is_aligned (pbase, size, 8)) Change "8" to "alignof (uint64_t)". > + swap_type = SWAP_WORDS_64; > + else if (is_aligned (pbase, size, 4)) Likewise, change "4" to "alignof (uint32_t)". Or is the problem that alignof didn't work for you? If so, perhaps __alignof__. Still, alignof is used elsewhere in glibc and is in C23 so it's better to use here if it works.