On Tue, May 14, 2019 at 7:03 AM Amnon Baron Cohen <amno...@gmail.com> wrote:

> > go version
> go version go1.12.5 linux/amd64
> > GODEBUG=cpu.avx=off go build hello.go
> > objdump -d hello | grep '%ymm'
>   4021bd: c5 fe 6f 16          vmovdqu (%rsi),%ymm2
>   4021c1: c5 fe 6f 1f          vmovdqu (%rdi),%ymm3
>   4021c5: c5 fe 6f 66 20        vmovdqu 0x20(%rsi),%ymm4
>
> > GODEBUG=cpu.avx=off,cpu.avx2=off go build hello.go
> > objdump -d hello | grep '%ymm' |head
>   4021bd: c5 fe 6f 16          vmovdqu (%rsi),%ymm2
>   4021c1: c5 fe 6f 1f          vmovdqu (%rdi),%ymm3
>   4021c5: c5 fe 6f 66 20        vmovdqu 0x20(%rsi),%ymm4
>   4021ca: c5 fe 6f 6f 20        vmovdqu 0x20(%rdi),%ymm5

Yes: GODEBUG=cpu.avx=off affects runtime execution.  It does not
affect the compiler.  You should set it when running the program.  It
will override the CPU detection to say that AVX instructions are not
available on this processor.

There is no way to change what the compiler generates.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVt1pY5Sp1oSO4e3UWL7%3D7QVxu8pYFU3z3OVM%3D_sEMy5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to