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
5d5e9f74
Commit
5d5e9f74
authored
Sep 15, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug - divide and mod of a byte
R=r OCL=15370 CL=15370
parent
6f380633
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
gen.c
src/cmd/6g/gen.c
+15
-7
No files found.
src/cmd/6g/gen.c
View file @
5d5e9f74
...
...
@@ -1001,26 +1001,34 @@ dodiv(int op, Node *nl, Node *nr, Node *res, Node *ax, Node *dx)
{
int
a
;
Node
n3
;
Type
*
t
;
a
=
optoas
(
op
,
nl
->
type
);
t
=
nl
->
type
;
if
(
t
->
width
==
1
)
{
if
(
issigned
[
t
->
etype
])
t
=
types
[
TINT32
];
else
t
=
types
[
TUINT32
];
}
a
=
optoas
(
op
,
t
);
if
(
!
issigned
[
nl
->
type
->
etype
])
{
nodconst
(
&
n3
,
nl
->
type
,
0
);
if
(
!
issigned
[
t
->
etype
])
{
nodconst
(
&
n3
,
t
,
0
);
gmove
(
&
n3
,
dx
);
}
regalloc
(
&
n3
,
nr
->
type
,
N
);
if
(
nl
->
ullman
>=
nr
->
ullman
)
{
cgen
(
nl
,
ax
);
if
(
issigned
[
nl
->
type
->
etype
])
gins
(
optoas
(
OFOR
,
nl
->
type
),
N
,
N
);
if
(
issigned
[
t
->
etype
])
gins
(
optoas
(
OFOR
,
t
),
N
,
N
);
cgen
(
nr
,
&
n3
);
gins
(
a
,
&
n3
,
N
);
}
else
{
cgen
(
nr
,
&
n3
);
cgen
(
nl
,
ax
);
if
(
issigned
[
nl
->
type
->
etype
])
gins
(
optoas
(
OFOR
,
nl
->
type
),
N
,
N
);
if
(
issigned
[
t
->
etype
])
gins
(
optoas
(
OFOR
,
t
),
N
,
N
);
gins
(
a
,
&
n3
,
N
);
}
regfree
(
&
n3
);
...
...
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