bug-gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lshift bug


From: Klaus Schleisiek
Subject: Re: lshift bug
Date: Sun, 17 May 2020 17:52:29 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Am 16.05.2020 um 18:06 schrieb Anton Ertl:
> In Gforth, LSHIFT does what unsigned << does in gcc (it's undefined in
> C, and AFAIK GNU C does not define it, either), which is typically
> what the hardware does.  On a lot of hardware, for 64-bit shifts only
> the low-order 6 bits are passed to the shifter (i.e., shift by 64 is
> equivalent to shift by 0).

Aber wenn C es mathematisch inkorrekt macht und etliche Vendors das nachgemacht
haben, so dass der Fall nicht standardisiert werden konnte, dann könnte gforth
es ja wenigstens korrekt machen. Oder bricht dadurch zu viel Code?

Jedenfalls ist mein Code gebrochen, als ich : 2**  1 swap lshift ; definiert
habe statt vorher : 2**  1 swap 0 ?DO 2* LOOP ;

Aber so, wie der Standard jetzt ist, bleibt mir nix anderes übrig.

-- 
Klaus Schleisiek
Am Elbufer 8
29478 Höhbeck-Vietze
05846 9804008



reply via email to

[Prev in Thread] Current Thread [Next in Thread]