On Tue, Feb 1, 2022 at 4:34 AM Klaus Post <klausp...@gmail.com> wrote:
>
> I looked through the source to see if `GOAMD64` version results in build tags 
> being set, but I was unsure if that is the case.
>
> It would be really helpful for assembly code that can be assumed to work 
> without cpuid checks, avoiding a bit of branching.
>
> For example adding goamd64_v1...goamd64_v4 tags depending on the version set 
> at compile would be very helpful.
>
> Apologies if I missed it already existing.

Historically the go tool hasn't provided build tags for any of the
GO${GOARCH} environment variables.  What it does do is define macros
that the assembler code can check using #ifdef.  It will define
GOAMD64_vN where N is the value from the GOAMD64 environment variable
at build time.  Perhaps that will be sufficient for your purposes.

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/CAOyqgcU4%2BsZCOzW6CdvZNojh8QobbiajdhR3HXHdEPwcg2U99Q%40mail.gmail.com.

Reply via email to