Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1818)

Issue 6922049: code review 6922049: cmd/6g, cmd/8g: simplify integer division code. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by remyoudompheng
Modified:
12 years, 3 months ago
Reviewers:
CC:
golang-dev, rsc
Visibility:
Public.

Description

cmd/6g, cmd/8g: simplify integer division code. Change suggested by iant. The compiler generates special code for a/b when a is -0x80...0 and b = -1. A single instruction can cover the case where b is -1, so only one comparison is needed. Fixes issue 3551.

Patch Set 1 #

Patch Set 2 : diff -r ec3ae5b98922 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r ec3ae5b98922 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r ec3ae5b98922 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -30 lines) Patch
M src/cmd/6g/ggen.c View 1 3 chunks +11 lines, -19 lines 0 comments Download
M src/cmd/8g/ggen.c View 1 3 chunks +10 lines, -11 lines 0 comments Download

Messages

Total messages: 3
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 3 months ago (2012-12-11 23:46:41 UTC) #1
rsc
LGTM
12 years, 3 months ago (2012-12-12 04:08:33 UTC) #2
remyoudompheng
12 years, 3 months ago (2012-12-12 07:35:59 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=a3a847781593 ***

cmd/6g, cmd/8g: simplify integer division code.

Change suggested by iant. The compiler generates
special code for a/b when a is -0x80...0 and b = -1.
A single instruction can cover the case where b is -1,
so only one comparison is needed.

Fixes issue 3551.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/6922049
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b