digitalmars.D.ldc - Controlling SIMD codegen on a module by module basis?
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
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
On Sunday, 7 January 2024 at 12:08:17 UTC, Johan wrote:On Sunday, 7 January 2024 at 10:48:47 UTC, claptrap wrote:thanksSay 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