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
d8c79805
Commit
d8c79805
authored
Jan 06, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment sudoaddable;
remove unused second parameter. R=ken OCL=22126 CL=22126
parent
8318187f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
cgen.c
src/cmd/6g/cgen.c
+3
-3
gen.c
src/cmd/6g/gen.c
+3
-3
gg.h
src/cmd/6g/gg.h
+1
-1
gsubr.c
src/cmd/6g/gsubr.c
+14
-2
No files found.
src/cmd/6g/cgen.c
View file @
d8c79805
...
@@ -66,7 +66,7 @@ cgen(Node *n, Node *res)
...
@@ -66,7 +66,7 @@ cgen(Node *n, Node *res)
break
;
break
;
}
}
if
(
sudoaddable
(
res
,
n
->
type
,
&
addr
))
{
if
(
sudoaddable
(
res
,
&
addr
))
{
a
=
optoas
(
OAS
,
res
->
type
);
a
=
optoas
(
OAS
,
res
->
type
);
if
(
f
)
{
if
(
f
)
{
regalloc
(
&
n2
,
res
->
type
,
N
);
regalloc
(
&
n2
,
res
->
type
,
N
);
...
@@ -104,7 +104,7 @@ cgen(Node *n, Node *res)
...
@@ -104,7 +104,7 @@ cgen(Node *n, Node *res)
goto
ret
;
goto
ret
;
}
}
if
(
sudoaddable
(
n
,
res
->
type
,
&
addr
))
{
if
(
sudoaddable
(
n
,
&
addr
))
{
a
=
optoas
(
OAS
,
n
->
type
);
a
=
optoas
(
OAS
,
n
->
type
);
if
(
res
->
op
==
OREGISTER
)
{
if
(
res
->
op
==
OREGISTER
)
{
p1
=
gins
(
a
,
N
,
res
);
p1
=
gins
(
a
,
N
,
res
);
...
@@ -340,7 +340,7 @@ abop: // asymmetric binary
...
@@ -340,7 +340,7 @@ abop: // asymmetric binary
regalloc
(
&
n1
,
nl
->
type
,
res
);
regalloc
(
&
n1
,
nl
->
type
,
res
);
cgen
(
nl
,
&
n1
);
cgen
(
nl
,
&
n1
);
if
(
sudoaddable
(
nr
,
nl
->
type
,
&
addr
))
{
if
(
sudoaddable
(
nr
,
&
addr
))
{
p1
=
gins
(
a
,
N
,
&
n1
);
p1
=
gins
(
a
,
N
,
&
n1
);
p1
->
from
=
addr
;
p1
->
from
=
addr
;
gmove
(
&
n1
,
res
);
gmove
(
&
n1
,
res
);
...
...
src/cmd/6g/gen.c
View file @
d8c79805
...
@@ -987,7 +987,7 @@ cgen_asop(Node *n)
...
@@ -987,7 +987,7 @@ cgen_asop(Node *n)
gins
(
optoas
(
OINC
,
nl
->
type
),
N
,
nl
);
gins
(
optoas
(
OINC
,
nl
->
type
),
N
,
nl
);
goto
ret
;
goto
ret
;
}
}
if
(
sudoaddable
(
nl
,
nr
->
type
,
&
addr
))
{
if
(
sudoaddable
(
nl
,
&
addr
))
{
p1
=
gins
(
optoas
(
OINC
,
nl
->
type
),
N
,
N
);
p1
=
gins
(
optoas
(
OINC
,
nl
->
type
),
N
,
N
);
p1
->
to
=
addr
;
p1
->
to
=
addr
;
sudoclean
();
sudoclean
();
...
@@ -1003,7 +1003,7 @@ cgen_asop(Node *n)
...
@@ -1003,7 +1003,7 @@ cgen_asop(Node *n)
gins
(
optoas
(
ODEC
,
nl
->
type
),
N
,
nl
);
gins
(
optoas
(
ODEC
,
nl
->
type
),
N
,
nl
);
goto
ret
;
goto
ret
;
}
}
if
(
sudoaddable
(
nl
,
nr
->
type
,
&
addr
))
{
if
(
sudoaddable
(
nl
,
&
addr
))
{
p1
=
gins
(
optoas
(
ODEC
,
nl
->
type
),
N
,
N
);
p1
=
gins
(
optoas
(
ODEC
,
nl
->
type
),
N
,
N
);
p1
->
to
=
addr
;
p1
->
to
=
addr
;
sudoclean
();
sudoclean
();
...
@@ -1031,7 +1031,7 @@ cgen_asop(Node *n)
...
@@ -1031,7 +1031,7 @@ cgen_asop(Node *n)
goto
ret
;
goto
ret
;
}
}
if
(
nr
->
ullman
<
UINF
)
if
(
nr
->
ullman
<
UINF
)
if
(
sudoaddable
(
nl
,
nr
->
type
,
&
addr
))
{
if
(
sudoaddable
(
nl
,
&
addr
))
{
if
(
smallintconst
(
nr
))
{
if
(
smallintconst
(
nr
))
{
p1
=
gins
(
optoas
(
n
->
etype
,
nl
->
type
),
nr
,
N
);
p1
=
gins
(
optoas
(
n
->
etype
,
nl
->
type
),
nr
,
N
);
p1
->
to
=
addr
;
p1
->
to
=
addr
;
...
...
src/cmd/6g/gg.h
View file @
d8c79805
...
@@ -215,7 +215,7 @@ Plist* newplist(void);
...
@@ -215,7 +215,7 @@ Plist* newplist(void);
int
isfat
(
Type
*
);
int
isfat
(
Type
*
);
void
setmaxarg
(
Type
*
);
void
setmaxarg
(
Type
*
);
void
sudoclean
(
void
);
void
sudoclean
(
void
);
int
sudoaddable
(
Node
*
,
Type
*
,
Addr
*
);
int
sudoaddable
(
Node
*
,
Addr
*
);
/*
/*
* list.c
* list.c
...
...
src/cmd/6g/gsubr.c
View file @
d8c79805
...
@@ -1857,8 +1857,19 @@ sudoclean(void)
...
@@ -1857,8 +1857,19 @@ sudoclean(void)
cleani
-=
2
;
cleani
-=
2
;
}
}
/*
* generate code to compute address of n,
* a reference to a (perhaps nested) field inside
* an array or struct.
* return 0 on failure, 1 on success.
* on success, leaves usable address in a.
*
* caller is responsible for calling sudoclean
* after successful sudoaddable,
* to release the register used for a.
*/
int
int
sudoaddable
(
Node
*
n
,
Type
*
t
,
Addr
*
a
)
sudoaddable
(
Node
*
n
,
Addr
*
a
)
{
{
int
o
,
i
,
w
;
int
o
,
i
,
w
;
int
oary
[
10
];
int
oary
[
10
];
...
@@ -1866,8 +1877,9 @@ sudoaddable(Node *n, Type *t, Addr *a)
...
@@ -1866,8 +1877,9 @@ sudoaddable(Node *n, Type *t, Addr *a)
Node
n1
,
n2
,
*
nn
,
*
l
,
*
r
;
Node
n1
,
n2
,
*
nn
,
*
l
,
*
r
;
Node
*
reg
,
*
reg1
;
Node
*
reg
,
*
reg1
;
Prog
*
p1
;
Prog
*
p1
;
Type
*
t
;
if
(
n
->
type
==
T
||
t
==
T
)
if
(
n
->
type
==
T
)
return
0
;
return
0
;
switch
(
n
->
op
)
{
switch
(
n
->
op
)
{
...
...
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