DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 16 07:31:02 PDT 2014


On 16 July 2014 15:14, Daniel Murphy via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> "Johannes Pfau"  wrote in message news:lq5pv1$2nfb$1 at digitalmars.com...
>
>
>> > The problem is not 'this feature is too complex', the problems is
>> > that it's more complex than necessary.
>>
>> So what's necessary in this specific case?
>
>
> Use intrinsics with a nice template wrapper.  They get inlined, the unused
> function bodies get stripped, and the debug info/typeinfo is just as big a
> problem as it is for every other function in your program.
>
> Intrinsics get us away from our current 'there is no portable way to do
> this' situation.

No they don't.  Intrinsics make things worse.

> They are _trivial_ to implement for any of the compilers.

No they aren't, unless you are talking specifically about volatile.,
in which case, that depends...

> I have complete faith that it is possible to make a performant wrapper for
> both the single-register read/write and the struct pattern you posted.  And
> if I'm wrong - we can add a volatile type modifier later!
>
> I just don't see volatile pulling it's weight.

Hardware access is supposed to be correct, not performant.

Regards
Iain


More information about the Digitalmars-d mailing list