On Saturday, 29 April 2017 at 11:48:46 UTC, Ola Fosheim Grøstad wrote:
On Saturday, 29 April 2017 at 11:24:36 UTC, Patrick Schluter wrote:
C99 says "if an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int."

Well, C is making the simple assumption that registers are int-sized...

That's not a simple assumption, it's acknowledgment that a C program runs on real
hardware not a virtual machine like Java or C#.

This is no longer true of course, as "registers" are "SIMD sized".

SIMD and GP are not related and one will never replace the other. SIMD is generally for floating point, when it is used for integer, it is not for the usual integer semantics and requires special handling in any case.

So I am pretty sure it will lead to suboptimal code in some instances.

Can also be said if it had another semantic.


While quite often surprising for people coming from other languages, I think that Walter's persistence in following the basic C rule is a good thing.

Why is it a good thing?

For the same reason it is in C. If the ambition for D is to be a system language then it should avoid introducing artificial abstractions and work with the machine it runs on, not against.
  • Re: "Competitiv... Atila Neves via Digitalmars-d-announce
    • Re: "Compe... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
      • Re: "C... H. S. Teoh via Digitalmars-d-announce
      • Re: "C... Ali Çehreli via Digitalmars-d-announce
        • Re: &qu... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
      • Re: "C... Ola Fosheim Grostad via Digitalmars-d-announce
      • Re: "C... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
        • Re: &qu... Ola Fosheim Grøstad via Digitalmars-d-announce
      • Re: "C... Patrick Schluter via Digitalmars-d-announce
        • Re: &qu... Ola Fosheim Grøstad via Digitalmars-d-announce
          • Re:... Patrick Schluter via Digitalmars-d-announce
            • ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • ... Adam D. Ruppe via Digitalmars-d-announce
        • Re: &qu... H. S. Teoh via Digitalmars-d-announce

Reply via email to