From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32540 invoked from network); 16 May 2020 20:38:05 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 16 May 2020 20:38:05 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7CD279C5EE; Sun, 17 May 2020 06:38:00 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 653F19C5E4; Sun, 17 May 2020 06:37:32 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="xzqtJav6"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 3B53E9C5E4; Sun, 17 May 2020 06:37:29 +1000 (AEST) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by minnie.tuhs.org (Postfix) with ESMTPS id E5EFB9C5E1 for ; Sun, 17 May 2020 06:37:27 +1000 (AEST) Received: by mail-qk1-f177.google.com with SMTP id s1so6316256qkf.9 for ; Sat, 16 May 2020 13:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=39TITm2UsCkCi1FHTq1S4o/c7dW5cgQgtDjGeAYSCKs=; b=xzqtJav6C9UW6WEAwVxP/ocTDmL7sQksP2Iuyg7VPadEj1tYcOMXkbtiDkr/YiW2Ov cXSwtlaT7gTqar5Pl7+0UMjAL07bMNemRF7+jNaM3jCfDGmXtInR1CXFFVOdMHriHYsd NEbQjRy/NFPCMx+LGRH6oYosb5COA+I+TiYMzTo0BZi+y0ZZtz82sjgj0sFn7l1PVgLP v5oPm9MwKvshyxj3sItiDfNmLKvrkYfiI9DNOOYlIoAVELV1MYuhY9hxuk3T9+ySrxjE D+YfRV+/mbVZAWHkAmivC914ojUymlQjA9A0fC/mNVIs6V6g+PSVUyvBTdc26H+7zpQK XKAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=39TITm2UsCkCi1FHTq1S4o/c7dW5cgQgtDjGeAYSCKs=; b=N6yM6BulxAEK8Sx1buKH7L5HFpk1BFNZ0aPMLx/vw9jOpdzOmyeqw58ZsG+98hptdH tEEfxrEwWNUFp2IWLpQaPZYjZoOiQAvPYtdFspNoAUkbgV0o6HxHmCx2OjIF+nCvnCiu DIxo2UjIdc8GIqYqTGbAidQhXk7fUADgEMtw17PnU8KWafVTfFqT5Uu/LYF5vYzIUwn5 6QuQz4luDVTGQMqeBCIONdhZKnkj6q+4bON6aQsTGC1gGG2oL4tGpeWLJ5M/a4rezsmT eIu9YNGJYeZS259XZbEJOTFMWuVsdM6WlfKhoa6aco+vn1W4PG8EScrh1VpfcdmuYvrs zI2Q== X-Gm-Message-State: AOAM533SOMQZ06xyUVM54myFokt+vAne2e0CYsDdIV0sQ8TKPox+g/tG ubBosTj2oBdCbCY0XVhJJw7+KIz3yBgOZ007XiDAUw== X-Google-Smtp-Source: ABdhPJy5nWaxabbDZPPmoagSxapys5ushzrcONsu1ffeRwajgV+P8kd/vE/Y6mVEVz5Uw9SCSEg3OF5rkWpQs6a1CY4= X-Received: by 2002:a37:6e42:: with SMTP id j63mr9159938qkc.495.1589661446743; Sat, 16 May 2020 13:37:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 16 May 2020 14:37:15 -0600 Message-ID: To: Brad Spencer Content-Type: multipart/alternative; boundary="000000000000d8c3f205a5c9e5d6" Subject: Re: [TUHS] v7 K&R C X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000d8c3f205a5c9e5d6 Content-Type: text/plain; charset="UTF-8" On Sat, May 16, 2020 at 2:35 PM Brad Spencer wrote: > Paul Winalski writes: > > > On 5/15/20, Warner Losh wrote: > >> > >> arm has been the biggest outlier in terms of unsigned char. In FreeBSD, > >> this has been the second largest source of bugs with the platform... the > >> OABI weird alignment requirements being the first (thankfully behind > us)... > > > > Why did the implementers of the Unix ABI for ARM decide to have char > > be unsigned? Was there an architectural reason for it? > > > > -Paul W. > > > My understanding is that it is a lot more efficient to use unsigned char > on arm. You can make gcc, for example, deal with this, but it costs. I > remember having to tell gcc to deal with it when I ported the Doom > engine to a StrongARM processor device under NetBSD many years ago. I > mostly remember the code running well enough, but it was larger. > I've seen numbers that suggest it's about 10% smaller to use unsigned characters, and the code runs 5-10% faster. I've not looked at the generated code to understand why, exactly, that might be the case. Warner --000000000000d8c3f205a5c9e5d6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, May 16, 2020 at 2:35 PM Brad = Spencer <brad@anduin.eldar.org<= /a>> wrote:
P= aul Winalski <paul.winalski@gmail.com> writes:

> On 5/15/20, Warner Losh <imp@bsdimp.com> wrote:
>>
>> arm has been the biggest outlier in terms of unsigned char. In Fre= eBSD,
>> this has been the second largest source of bugs with the platform.= .. the
>> OABI weird alignment requirements being the first (thankfully behi= nd us)...
>
> Why did the implementers of the Unix ABI for ARM decide to have char > be unsigned?=C2=A0 Was there an architectural reason for it?
>
> -Paul W.


My understanding is that it is a lot more efficient to use unsigned char on arm.=C2=A0 You can make gcc, for example, deal with this, but it costs.= =C2=A0 I
remember having to tell gcc to deal with it when I ported the Doom
engine to a StrongARM processor device under NetBSD many years ago.=C2=A0 I=
mostly remember the code running well enough, but it was larger.

I've seen numbers that suggest it's about= 10% smaller to use unsigned characters, and the code runs 5-10% faster. I&= #39;ve not looked at the generated code to understand why, exactly, that mi= ght be the case.

Warner
--000000000000d8c3f205a5c9e5d6--