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

Issue 9040043: code review 9040043: cmd/6c, cmd/8c: avoid generating long multiplication wh... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by remyoudompheng
Modified:
10 years, 10 months ago
Reviewers:
rsc
CC:
golang-dev, iant, dfc, DMorsing, ality, rsc
Visibility:
Public.

Description

cmd/6c, cmd/8c: avoid generating long multiplication when not necessary. On amd64 benchmark old ns/op new ns/op delta BenchmarkHashStringSpeed 91 74 -18.49% BenchmarkHashInt32Speed 54 45 -17.88% BenchmarkHashInt64Speed 76 58 -23.53% BenchmarkHashStringArraySpeed 231 188 -18.61% Fixes issue 5367.

Patch Set 1 #

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

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

Total comments: 2

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -4 lines) Patch
M src/cmd/6c/cgen.c View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M src/cmd/8c/cgen.c View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 16
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/
10 years, 11 months ago (2013-05-04 11:12:47 UTC) #1
iant
My inclination would be to hold this until after 1.1.
10 years, 11 months ago (2013-05-04 16:09:40 UTC) #2
dfc
Ping. The change window has been well and truly thrown open. On Sun, May 5, ...
10 years, 11 months ago (2013-05-15 00:26:12 UTC) #3
iant
I like the idea but frankly I have no idea what this change is doing. ...
10 years, 11 months ago (2013-05-15 13:45:29 UTC) #4
DMorsing
On 2013/05/15 13:45:29, iant wrote: > I like the idea but frankly I have no ...
10 years, 11 months ago (2013-05-15 13:49:31 UTC) #5
remyoudompheng
gopcode does logic on usage count of DX to do short or long multiplication. (weird) ...
10 years, 11 months ago (2013-05-15 14:15:24 UTC) #6
ality
Rémy, Shouldn't you instead duplicate the gopcode AX/DX logic for the OASLMUL/OLMUL case? With your ...
10 years, 11 months ago (2013-05-15 14:32:53 UTC) #7
ality
To restate my question: doesn't this effectively turn unsigned multiplication into signed?
10 years, 11 months ago (2013-05-15 14:50:59 UTC) #8
remyoudompheng
What do you mean by signed multiplication? It would only make sense for the long ...
10 years, 11 months ago (2013-05-15 14:59:55 UTC) #9
ality
On 2013/05/15 14:59:55, remyoudompheng wrote: > What do you mean by signed multiplication? It would ...
10 years, 11 months ago (2013-05-15 15:22:02 UTC) #10
remyoudompheng
On 2013/05/15 15:22:02, ality wrote: > On 2013/05/15 14:59:55, remyoudompheng wrote: > > What do ...
10 years, 11 months ago (2013-05-18 08:19:56 UTC) #11
dfc
> OLMUL is mapped to MUL and OMUL is mapped to IMUL That is not ...
10 years, 11 months ago (2013-05-18 08:21:02 UTC) #12
dfc
ping.
10 years, 11 months ago (2013-05-21 12:00:53 UTC) #13
dfc
On 2013/05/21 12:00:53, dfc wrote: > ping. ping
10 years, 11 months ago (2013-05-27 22:05:42 UTC) #14
rsc
LGTM https://codereview.appspot.com/9040043/diff/5001/src/cmd/6c/cgen.c File src/cmd/6c/cgen.c (right): https://codereview.appspot.com/9040043/diff/5001/src/cmd/6c/cgen.c#newcode401 src/cmd/6c/cgen.c:401: reg[D_DX]++; // avoid doing long multiplication. Please change ...
10 years, 10 months ago (2013-06-03 19:43:14 UTC) #15
remyoudompheng
10 years, 10 months ago (2013-06-04 06:34:36 UTC) #16
*** Submitted as https://code.google.com/p/go/source/detail?r=1c764773c6ce ***

cmd/6c, cmd/8c: avoid generating long multiplication when not necessary.

On amd64
benchmark                        old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                91           74  -18.49%
BenchmarkHashInt32Speed                 54           45  -17.88%
BenchmarkHashInt64Speed                 76           58  -23.53%
BenchmarkHashStringArraySpeed          231          188  -18.61%

Fixes issue 5367.

R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://codereview.appspot.com/9040043

https://codereview.appspot.com/9040043/diff/5001/src/cmd/6c/cgen.c
File src/cmd/6c/cgen.c (right):

https://codereview.appspot.com/9040043/diff/5001/src/cmd/6c/cgen.c#newcode401
src/cmd/6c/cgen.c:401: reg[D_DX]++; // avoid doing long multiplication.
On 2013/06/03 19:43:15, rsc wrote:
> Please change this comment to
> 
> // for gopcode case OMUL
> 

Done.
Sign in to reply to this message.

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