4 ms·
If you want to "poke at the processor" with Go, its toolchain makes it pretty easy to use assembly in your package.
by Jayschwa 13y ago
If you want to "poke at the processor" with Go, its toolchain makes it pretty easy to use assembly in your package.
- pbsd 13y agoGo uses an assembly syntax completely different from everyone else. That's mighty annoying.
- RamiK 13y agoHa? Doesn't it work through the 'import "C"' and then it's just regular C?
- pbsd 13y agoI meant something like this, i.e. not going through C at all: http://golang.org/src/pkg/syscall/asm_freebsd_amd64.s http://golang.org/src/pkg/syscall/asm_freebsd_amd64.s
- mseepgood 13y agoIt looks like AT&T assembly without the %s. Not really that weird.
- RamiK 13y agoOh. You mean the Plan 9 assembler... It's pretty good looking to me so I haven't really considered that an issue. I guess you're on the other side of the AT&T vs. Intel assembly fence... But just how much assembly are we writing this days anyhow? I say, just wrap it all up in Go (or C through cgo) and be done with it.
- corresation 13y agoYou can use C files and GCC syntax in your Go project. Go will use Cgo and compile it with GCC.
- _ak 13y agoWhere "everyone else" is at least two different syntaxes in the first place, Intel and AT&T.
- frozenport 13y agoC++ does it automatically, I think this is a call for Google to spend some more time optimizing floating point workloads.