On Tue, Sep 13, 2016 at 6:19 AM,  <pcj...@gmail.com> wrote:
> My interpretation of golang's assembly is that it represents an intermediate
> pseudo-language that is transformed via "instruction selection" to a
> concrete form.

Correct, but this pseudo-language is not portable between architectures.

> Therefore, is it possible to re-write the above to a cross-compilable form?

The assembly in the Go distribution is already cross-compilable, but
looking at your example you are not concerned whether the assembly is
cross-compilable or not (that depends on the toolchain, and not on the
assembly code), but you want the assembly to be portable between
architectures.

Apart from the most trivial of cases, this is not possible. Different
targets use different instructions and different registers.

The Go assembler uses the same *syntax* on every architecture, so it
can be parsed and processed by a single program, however the assembly
code required for each target is very different.

-- 
Aram Hăvărneanu

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

Reply via email to