gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] register keyword?


From: Kurt Schwehr
Subject: Re: [gpsd-dev] register keyword?
Date: Mon, 22 Jan 2018 15:04:13 -0800

The general compiler folks consensus is that the optimizers generally just ignore register and it's being removed from C++17.  Linking against C++17 code is my main reason for this.

But that's why we have https://godbolt.org/ to easily try it out.

Looking at gcc x86-64 7.2, the assembly without register is shorter.  I used this

    https://pastebin.com/M7zu3Wr2

without register it gets to use QWORD PTR

But when you add this:

   #pragma GCC optimize("O3")

The assembly with and without registers is exactly the same.


On Mon, Jan 22, 2018 at 2:32 PM, Hal Murray <address@hidden> wrote:

address@hidden said:
>> Is there still a reason to keep the register keyword in gpsd?
> Maybe.  It is in the critical path of some time measurements.

Do modern compilers pay attention to it?



--
These are my opinions.  I hate spam.







--

reply via email to

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