Disable AVX, AVX2, AVX-512, SSE support while building a go binary
496 views
Skip to first unread message
aditi sinha
unread,
Apr 6, 2023, 1:18:03 AM4/6/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi
I want to build a simple go binary that prints "hello world" but disablesthe use of all optional instruction set extensions e.g disable AVX, AVX2, AVX-512, SSE support .
Thanks
Aditi
Brian Candler
unread,
Apr 6, 2023, 3:49:46 AM4/6/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
The default is GOAMD64=v1 so the fancy extensions are disabled by default (or guarded).
Uli Kunitz
unread,
Apr 7, 2023, 2:22:14 AM4/7/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Note that SSE2 is not optional and is used for floating point operations on 386 and AMD64. Before 1.16 there has been a GO386 option that supported 387 instructions but it has been removed. GOAMD64 has no influence on it.
Uli Kunitz
unread,
Apr 7, 2023, 2:35:46 AM4/7/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
After reading the documentation I have to correct. GO386 supports the softfloat option to support older processors which don't support SSE2.