NASM Forum > Programming with NASM

build in avx instructions on non avx processor

(1/1)

stoffel:
Hi,
Can I build an executable that includes avx instructions on a processor that is not avx capable?
I suspect there is some flag that one can specify to build binary for avx capable processor
even though build system is not an avx vintage processor.
Thanks.

Frank Kotler:
Hi stoffel,

Yeah, shouldn't be a problem. I just tried avx005.asm (from the "test" directory in the source code) on my clunky old P4 with nasm-2.09.10 and it seemed to go okay. I can't test the result, of course!

Nasm's "cpu" directive disables instructions "higher" than the specified cpu (causes an error). Without a "cpu" directive, or any other special flag, Nasm should assemble "anything". You'll want a fairly recent version of Nasm, to get "bug free" (we hope) avx instructions.

Try it, and let us know if you encounter any problem.

Best,
Frank

Navigation

[0] Message Index

Go to full version