On 13 April 2016 at 11:13, Marco Leise via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > Am Wed, 13 Apr 2016 09:51:25 +0200 > schrieb Iain Buclaw via Digitalmars-d > <digitalmars-d@puremagic.com>: > >> On 13 April 2016 at 07:59, Walter Bright via Digitalmars-d >> <digitalmars-d@puremagic.com> wrote: >> > But core.cpuid needs to be made to work in GDC, whatever it takes to do so. >> > >> >> Indeed, it's been on my TODO list for a long time, among many other things. >> :-) > > Would you want to implement this in the compiler like the > checkedint functions? I guess that's the only way to guarantee > cross-module inlining with GDC. Otherwise I would use > __builtin_cpu_supports (const char *feature). (GCC practically > has its own internal core.cpuid implementation made of > intrinsics.) > > -- > Marco >
Yes, cpu_supports is a good way to do it as we only need to invoke __builtin_cpu_init once and cache all values when running 'shared static this()'. I would also like to be able to support other processes too. ARM is a high priority one which should follow suit.