www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Controlling SIMD codegen on a module by module basis?

reply claptrap <clap trap.com> writes:
Say you support no-SSE, SSE or AVX and you want to pick which to 
use at runtime. Is there a way to tell the optimizer not to use 
AVX, or SEE on a given module? Like set "-mattr" on a module by 
module basis?
Jan 07
parent reply Johan <j j.nl> writes:
On Sunday, 7 January 2024 at 10:48:47 UTC, claptrap wrote:
 Say you support no-SSE, SSE or AVX and you want to pick which 
 to use at runtime. Is there a way to tell the optimizer not to 
 use AVX, or SEE on a given module? Like set "-mattr" on a 
 module by module basis?
You can use ldc.attributes.target for this. https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.target.28.22feature.22.29.29 cheers, Johan
Jan 07
parent claptrap <clap trap.com> writes:
On Sunday, 7 January 2024 at 12:08:17 UTC, Johan wrote:
 On Sunday, 7 January 2024 at 10:48:47 UTC, claptrap wrote:
 Say you support no-SSE, SSE or AVX and you want to pick which 
 to use at runtime. Is there a way to tell the optimizer not to 
 use AVX, or SEE on a given module? Like set "-mattr" on a 
 module by module basis?
You can use ldc.attributes.target for this. https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.target.28.22feature.22.29.29 cheers, Johan
thanks
Jan 07