Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
6da41be2
Commit
6da41be2
authored
Jul 06, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix float32 comparison. was doing l op l instead of l op r.
R=ken OCL=31190 CL=31190
parent
86987055
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
cgen.c
src/cmd/8g/cgen.c
+7
-6
No files found.
src/cmd/8g/cgen.c
View file @
6da41be2
...
...
@@ -812,16 +812,17 @@ bgen(Node *n, int true, Prog *to)
cgen
(
nl
,
&
tmp
);
gins
(
AFUCOMPP
,
&
tmp
,
&
n2
);
}
else
{
// NOTE(rsc): This is wrong.
// It's right for comparison but presumably all the
// other ops have the same problem. We need to
// figure out what the right solution is, besides
// tell people to use float64.
// TODO(rsc): The moves back and forth to memory
// here are for truncating the value to 32 bits.
// This handles 32-bit comparison but presumably
// all the other ops have the same problem.
// We need to figure out what the right general
// solution is, besides telling people to use float64.
tempalloc
(
&
t1
,
types
[
TFLOAT32
]);
tempalloc
(
&
t2
,
types
[
TFLOAT32
]);
cgen
(
nr
,
&
t1
);
cgen
(
nl
,
&
t2
);
gmove
(
&
t
1
,
&
tmp
);
gmove
(
&
t
2
,
&
tmp
);
gins
(
AFCOMFP
,
&
t1
,
&
tmp
);
tempfree
(
&
t2
);
tempfree
(
&
t1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment