FAQ
We may decide to extend registers differently on different architectures.
  x86 has lots of support for sub-full-width operations, like 16-bit
compares that ignore higher bits, so it is easiest to just let the
higher-order bits be junk. Other architectures may want to fix
higher-order bits some other way.

On Wed, Apr 20, 2016 at 7:04 AM, Alexandru Moșoi wrote:

Thanks. I missed that comment. That clears up the (XORBconst [1] a)
correctness.

Is there a reason why this would not generalize to other architectures? I
have to admit I have zero knowledge outside of x86 / x86-64.



2016-04-20 15:51 GMT+02:00 Josh Bleecher Snyder <josharian@gmail.com>:
Last time I raised this question the answer was that bools are 0 and !=
0.

Keith documented here that (for SSA/amd64 at least) bools are 0 and 1:


https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/AMD64Ops.go#L13

-josh


--
Alexandru Moșoi
http://www.alexandru.mosoi.ro/

--
You received this message because you are subscribed to the Google Groups
"golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+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 | 4 of 15 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedApr 20, '16 at 9:42a
activeApr 22, '16 at 2:12p
posts15
users6
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase