FAQ

It is still something that we'd like to see, there are no plans at the
moment do to it as the current inlining scheme works at the source code
level, not the binary level.

Oh, okay.

You can either do a test and set a function variable which you branch
through at startup, we do this for the runtime map implementation, look at
runtime/hashmap_fast.(go,c) or compile two versions of your program using
build tags.

Could you provide line numbers for where this happens? I've been looking
but I am having trouble finding the code you are talking about.

Either use function pointer or use conditional jump. I guess conditional
jump is probably easier for branch predictor to get right than call though
a function pointer.

What is [a][the] branch predictor? I guess it predicts branching code and
does an optimization -- but how?

One last question -- Russ mentions in http://golang.org/issue/4978 that
allowing methods implemented in assembly would complicate the toolchain a
lot. It seems from my (rather naive) perspective that methods would be
almost identical to regular assembly functions ? It would also help me
write a cleaner API, for example:

func (a Vec32) Add(b Vec32) Vec32
func (a Vec32) Sub(b Vec32) Vec32
...
a.Add(b).Sub(c)

instead of:

func Vec32Add(a, b Vec32) Vec32
func Vec32Sub(a, b Vec32) Vec32
...
simd.Vec32Sub(simd.Vec32Add(a, b), c)

without another function call overhead inside the method (since they are
rather small operations). How badly would this complicate/hinder future
changes to the toolchain?

- Stephen

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 8 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 25, '14 at 10:27p
activeAug 30, '14 at 11:39a
posts8
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase