1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00
go/src/cmd/asm/internal
Rob Pike 989b372a5c cmd/asm: fix shifts again, this time for sure
There are two conditions to worry about:

1) The shift count cannot be negative. Since the evaluator uses unsigned
arithmetic throughout, this means checking that the high bit of
the shift count is always off, which is done by converting to int64
and seeing if the result is negative.

2) For right shifts, the value cannot be negative. We don't want a
high bit in the value because right shifting a value depends on the
sign, and for clarity we always want unsigned shifts.

Next step is to build some testing infrastructure for the parser.

Change-Id: I4c46c79989d02c107fc64954403fc18613763f1d
Reviewed-on: https://go-review.googlesource.com/11326
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-23 06:44:54 +00:00
..
arch cmd/asm: drop legacy RETURN mnemonic on ppc64 2015-06-06 00:11:13 +00:00
asm cmd/asm: fix shifts again, this time for sure 2015-06-23 06:44:54 +00:00
flags all: retire architecture letter in file names, public API 2015-05-21 17:32:17 +00:00
lex cmd/internal/obj: update callers to Linkline{fmt,hist} and remove 2015-05-15 17:45:39 +00:00