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

Issue 13722044: code review 13722044: runtime: fix uint64 division on 386 (Closed)

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

Description

runtime: fix uint64 division on 386 The uint64 divide function calls _mul64x32 to do a 64x32-bit multiply and then compares the result against the 64-bit numerator. If the result is bigger than the numerator, must use the slow path. Unfortunately, the 64x32 produces a 96-bit product, and only the low 64 bits were being used in the comparison. Return all 96 bits, the bottom 64 via the original uint64* pointer, and the top 32 as the function's return value. Fixes 386 build (broken by ARM division tests).

Patch Set 1 #

Patch Set 2 : diff -r a972ba4c78a8 https://code.google.com/p/go/ #

Patch Set 3 : diff -r a972ba4c78a8 https://code.google.com/p/go/ #

Total comments: 1

Patch Set 4 : diff -r a972ba4c78a8 https://code.google.com/p/go/ #

Patch Set 5 : diff -r a972ba4c78a8 https://code.google.com/p/go/ #

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

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 7 months ago (2013-09-16 19:03:14 UTC) #1
iant
LGTM https://codereview.appspot.com/13722044/diff/6001/src/pkg/runtime/vlrt_386.c File src/pkg/runtime/vlrt_386.c (right): https://codereview.appspot.com/13722044/diff/6001/src/pkg/runtime/vlrt_386.c#newcode214 src/pkg/runtime/vlrt_386.c:214: extern void runtime·printf(char*, ...); Remove this declaration before ...
11 years, 7 months ago (2013-09-16 19:09:46 UTC) #2
rsc
11 years, 7 months ago (2013-09-16 19:11:36 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=7c63f0eebb6a ***

runtime: fix uint64 division on 386

The uint64 divide function calls _mul64x32 to do a 64x32-bit multiply
and then compares the result against the 64-bit numerator.
If the result is bigger than the numerator, must use the slow path.

Unfortunately, the 64x32 produces a 96-bit product, and only the
low 64 bits were being used in the comparison. Return all 96 bits,
the bottom 64 via the original uint64* pointer, and the top 32
as the function's return value.

Fixes 386 build (broken by ARM division tests).

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

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