Re: Dual CPU code

2009-02-02 Thread Tim M
On Tue, 03 Feb 2009 00:31:17 +1300, bearophile wrote: This comes after a small discussion I've had in the #D IRC channel. I have seen that the LDC compiler is much more efficient if you use SSE(2) extensions, while it's not much efficient if you don't use them (GCC/GDC don't seem so much

Re: Dual CPU code

2009-02-02 Thread Christopher Wright
Andrei Alexandrescu wrote: Walter Bright wrote: bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bu

Re: Dual CPU code

2009-02-02 Thread BCS
Hello Andrei, bearophile wrote: module sse; mixin(import("shared_module_code.dd")); I must be missing something - why isn't import shared_module_code; good? Andrei the code generator needs to be run on the code more than once.

Re: Dual CPU code

2009-02-02 Thread Walter Bright
Andrei Alexandrescu wrote: Walter Bright wrote: bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bu

Re: Dual CPU code

2009-02-02 Thread Andrei Alexandrescu
Walter Bright wrote: bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bud that compiles all the prog

Re: Dual CPU code

2009-02-02 Thread BCS
Reply to bearophile, Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bud that compiles all the program in one go). I

Re: Dual CPU code

2009-02-02 Thread grauzone
Walter Bright wrote: bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bud that compiles all the prog

Re: Dual CPU code

2009-02-02 Thread Walter Bright
bearophile wrote: Walter Bright: import std.cpuid; import sse; import nosse; ... if (std.cpuid.sse2()) sse2.foo(); else nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bud that compiles all the program in one go). I pre

Re: Dual CPU code

2009-02-02 Thread bearophile
Walter Bright: > import std.cpuid; > import sse; > import nosse; > ... > if (std.cpuid.sse2()) > sse2.foo(); > else > nosse2.foo(); I think that solves my problem, thank you. It's a simple solution (maybe I didn't think of it because I use bud that compiles all the program in one go).

Re: Dual CPU code

2009-02-02 Thread Walter Bright
bearophile wrote: So, it may be useful to have a way to build executables able to run well on both CPUs (Apple has done something like this two or more times in the past). There are several ways to do this, a solution is to compile just critical functions for different CPUs, but that may require

Re: Dual CPU code

2009-02-02 Thread bearophile
Don: > Is this mostly integer, or floating point code? In that specific cases, it's mostly FP. If I compile it with LDC with -sse3 flags the resulting asm is a jungle of the new registers :-) Bye, bearophile

Re: Dual CPU code

2009-02-02 Thread Don
bearophile wrote: This comes after a small discussion I've had in the #D IRC channel. I have seen that the LDC compiler is much more efficient if you use SSE(2) extensions, while it's not much efficient if you don't use them (GCC/GDC don't seem so much sensitive to the presence of the SSE exte

Dual CPU code

2009-02-02 Thread bearophile
This comes after a small discussion I've had in the #D IRC channel. I have seen that the LDC compiler is much more efficient if you use SSE(2) extensions, while it's not much efficient if you don't use them (GCC/GDC don't seem so much sensitive to the presence of the SSE extensions). I often ha