Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ef61a4cb
Commit
ef61a4cb
authored
Jun 12, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better version of op=
fixed bugs in /= and %/ SVN=122493
parent
dbf1da6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
src/cmd/6g/gen.c
src/cmd/6g/gen.c
+23
-23
src/cmd/6g/gg.h
src/cmd/6g/gg.h
+1
-1
No files found.
src/cmd/6g/gen.c
View file @
ef61a4cb
...
...
@@ -275,7 +275,7 @@ loop:
break
;
case
OASOP
:
cgen_asop
(
n
->
left
,
n
->
right
,
n
->
etype
);
cgen_asop
(
n
);
break
;
case
OAS
:
...
...
@@ -683,40 +683,40 @@ cgen_ret(Node *n)
}
void
cgen_asop
(
Node
*
n
l
,
Node
*
nr
,
int
op
)
cgen_asop
(
Node
*
n
)
{
Node
n1
,
n2
;
int
a
;
Node
n1
,
n2
,
n3
,
n4
;
Node
*
nl
,
*
nr
;
nl
=
n
->
left
;
nr
=
n
->
right
;
if
(
nr
->
ullman
>=
UINF
&&
nl
->
ullman
>=
UINF
)
{
fatal
(
"cgen_asop both sides call"
);
}
// BOTCH make special case for DIVQ
a
=
optoas
(
op
,
nl
->
type
);
if
(
nl
->
addable
)
{
regalloc
(
&
n2
,
nr
->
type
,
N
);
if
(
nr
->
ullman
>
nl
->
ullman
)
{
regalloc
(
&
n2
,
nl
->
type
,
N
);
cgen
(
nr
,
&
n2
);
igen
(
nl
,
&
n1
,
N
);
}
else
{
igen
(
nl
,
&
n1
,
N
);
regalloc
(
&
n2
,
nl
->
type
,
N
);
cgen
(
nr
,
&
n2
);
regalloc
(
&
n1
,
nl
->
type
,
N
);
cgen
(
nl
,
&
n1
);
gins
(
a
,
&
n2
,
&
n1
);
gmove
(
&
n1
,
nl
);
regfree
(
&
n1
);
regfree
(
&
n2
);
return
;
}
if
(
nr
->
ullman
>
nl
->
ullman
)
{
fatal
(
"gcgen_asopen"
);
}
n3
=
*
n
;
n3
.
left
=
&
n1
;
n3
.
right
=
&
n2
;
n3
.
op
=
n
->
etype
;
regalloc
(
&
n4
,
nr
->
type
,
N
);
cgen
(
&
n3
,
&
n4
);
gmove
(
&
n4
,
&
n1
);
regalloc
(
&
n1
,
nl
->
type
,
N
);
igen
(
nl
,
&
n2
,
N
);
cgen
(
nr
,
&
n1
);
gins
(
a
,
&
n1
,
&
n2
);
regfree
(
&
n1
);
regfree
(
&
n2
);
regfree
(
&
n4
);
}
void
...
...
src/cmd/6g/gg.h
View file @
ef61a4cb
...
...
@@ -109,7 +109,7 @@ Node* lookdot(Node*, Node*, int);
void
inarggen
(
void
);
void
agen_inter
(
Node
*
,
Node
*
);
void
cgen_as
(
Node
*
,
Node
*
,
int
);
void
cgen_asop
(
Node
*
,
Node
*
,
int
);
void
cgen_asop
(
Node
*
);
void
cgen_ret
(
Node
*
);
void
cgen_call
(
Node
*
);
void
cgen_callmeth
(
Node
*
);
...
...
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