Author Topic: build in avx instructions on non avx processor  (Read 6357 times)

Offline stoffel

  • New Member
  • Posts: 1
build in avx instructions on non avx processor
« on: January 06, 2012, 02:02:05 PM »
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.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: build in avx instructions on non avx processor
« Reply #1 on: January 06, 2012, 05:55:23 PM »
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