On Tuesday, 1 February 2022 at 21:12:08 UTC+1 Ian Lance Taylor wrote: > On Tue, Feb 1, 2022 at 4:34 AM Klaus Post <klau...@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.
Oh, so that is what that part of the code is doing. That should be quite fine, and also reduces code duplication a lot, when I can convince avo to emit ifdefs. It seems to me like only the latest version is defined, which is a bit clunky, but doable. Build tags would help pure Go alternate paths, but the define in assembly should be ok for now. Thanks! > > 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/b628143f-1250-422d-b2da-13977d38c9d7n%40googlegroups.com.