code review 6442114: cmd/6g, cmd/8g: eliminate short integer arithmetic when... (issue 6442114)

57 views
Skip to first unread message

remyoud...@gmail.com

unread,
Aug 11, 2012, 8:15:43 AM8/11/12
to golan...@googlegroups.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golan...@googlegroups.com (cc: golan...@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
cmd/6g, cmd/8g: eliminate short integer arithmetic when possible.

Fixes issue 3909.
Fixes issue 3910.

Please review this at http://codereview.appspot.com/6442114/

Affected files:
M src/cmd/6g/peep.c
M src/cmd/8g/gsubr.c
M src/cmd/8g/peep.c
M test/fixedbugs/bug440_32.go
M test/fixedbugs/bug440_64.go


remyoud...@gmail.com

unread,
Aug 11, 2012, 8:22:46 AM8/11/12
to golan...@googlegroups.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
This patch intends to replace CL 6446088 and CL 6459046 by eliminating
short integer instructions whenever possible. It passes the tests but
can cause more issues: there were some with the carry bit (needc is not
complete) and a use of ORB with arguments being actual ints and not
bytes (in the uint64 -> float64 conversion).

http://codereview.appspot.com/6442114/

nige...@golang.org

unread,
Aug 13, 2012, 3:36:26 AM8/13/12
to remyoud...@gmail.com, r...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com

http://codereview.appspot.com/6442114/diff/7001/src/cmd/6g/peep.c
File src/cmd/6g/peep.c (right):

http://codereview.appspot.com/6442114/diff/7001/src/cmd/6g/peep.c#newcode139
src/cmd/6g/peep.c:139: // byte, word arithmetic elimination.
s/spaces/tabs/. Similarly on the next line.

http://codereview.appspot.com/6442114/diff/7001/src/cmd/8g/peep.c
File src/cmd/8g/peep.c (right):

http://codereview.appspot.com/6442114/diff/7001/src/cmd/8g/peep.c#newcode133
src/cmd/8g/peep.c:133: // byte, word arithmetic elimination.
s/spaces/tabs/.

http://codereview.appspot.com/6442114/diff/7001/test/fixedbugs/bug440_64.go
File test/fixedbugs/bug440_64.go (right):

http://codereview.appspot.com/6442114/diff/7001/test/fixedbugs/bug440_64.go#newcode1
test/fixedbugs/bug440_64.go:1: // run
Dumb question: is this file new? Why don't I see it in my tree?

http://codereview.appspot.com/6442114/diff/7001/test/fixedbugs/bug440_64.go#newcode4
test/fixedbugs/bug440_64.go:4: // about 64- vs 64-bit moves during
splitContractIndex.
"64- vs 64-bit" makes no sense.

http://codereview.appspot.com/6442114/
Reply all
Reply to author
Forward
0 new messages