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
7a87a3e0
Commit
7a87a3e0
authored
Aug 18, 2009
by
Kai Backman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slashed warnings
R=rsc APPROVED=rsc DELTA=35 (2 added, 1 deleted, 32 changed) OCL=33436 CL=33453
parent
e7acb5df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
91 deletions
+40
-91
src/cmd/5a/lex.c
src/cmd/5a/lex.c
+1
-1
src/cmd/5g/ggen.c
src/cmd/5g/ggen.c
+2
-2
src/cmd/5g/gobj.c
src/cmd/5g/gobj.c
+14
-13
src/cmd/5g/gsubr.c
src/cmd/5g/gsubr.c
+14
-13
src/cmd/5g/list.c
src/cmd/5g/list.c
+3
-3
src/cmd/5l/obj.c
src/cmd/5l/obj.c
+6
-59
No files found.
src/cmd/5a/lex.c
View file @
7a87a3e0
...
...
@@ -53,7 +53,7 @@ void
main
(
int
argc
,
char
*
argv
[])
{
char
*
p
;
int
nout
,
nproc
,
status
,
i
,
c
;
int
nout
,
nproc
,
i
,
c
;
thechar
=
'5'
;
thestring
=
"arm"
;
...
...
src/cmd/5g/ggen.c
View file @
7a87a3e0
...
...
@@ -111,7 +111,7 @@ void
ginscall
(
Node
*
f
,
int
proc
)
{
Prog
*
p
;
Node
reg
,
con
;
//
Node reg, con;
switch
(
proc
)
{
default:
...
...
@@ -340,7 +340,7 @@ cgen_asop(Node *n)
{
Node
n1
,
n2
,
n3
,
n4
;
Node
*
nl
,
*
nr
;
Prog
*
p1
;
//
Prog *p1;
Addr
addr
;
int
a
;
...
...
src/cmd/5g/gobj.c
View file @
7a87a3e0
...
...
@@ -83,7 +83,7 @@ void
zaddr
(
Biobuf
*
b
,
Addr
*
a
,
int
s
)
{
int32
l
;
Ieee
e
;
//
Ieee e;
int
i
;
char
*
n
;
...
...
@@ -142,18 +142,19 @@ zaddr(Biobuf *b, Addr *a, int s)
break
;
case
D_FCONST
:
ieeedtod
(
&
e
,
a
->
dval
);
l
=
e
.
l
;
Bputc
(
b
,
l
);
Bputc
(
b
,
l
>>
8
);
Bputc
(
b
,
l
>>
16
);
Bputc
(
b
,
l
>>
24
);
l
=
e
.
h
;
Bputc
(
b
,
l
);
Bputc
(
b
,
l
>>
8
);
Bputc
(
b
,
l
>>
16
);
Bputc
(
b
,
l
>>
24
);
break
;
fatal
(
"zaddr D_FCONST not implemented"
);
//ieeedtod(&e, a->dval);
//l = e.l;
//Bputc(b, l);
//Bputc(b, l>>8);
//Bputc(b, l>>16);
//Bputc(b, l>>24);
//l = e.h;
//Bputc(b, l);
//Bputc(b, l>>8);
//Bputc(b, l>>16);
//Bputc(b, l>>24);
//break;
}
}
...
...
src/cmd/5g/gsubr.c
View file @
7a87a3e0
...
...
@@ -420,8 +420,9 @@ gmove(Node *f, Node *t)
{
int
a
,
ft
,
tt
;
Type
*
cvt
;
Node
r1
,
r2
,
t1
,
t2
,
flo
,
fhi
,
tlo
,
thi
,
con
,
f0
,
f1
,
ax
,
dx
,
cx
;
Prog
*
p1
,
*
p2
,
*
p3
;
Node
r1
,
con
;
// Node r1, r2, t1, t2, flo, fhi, tlo, thi, con, f0, f1, ax, dx, cx;
// Prog *p1, *p2, *p3;
if
(
debug
[
'M'
])
print
(
"gmove %N -> %N
\n
"
,
f
,
t
);
...
...
@@ -948,7 +949,7 @@ gmove(Node *f, Node *t)
gins
(
a
,
f
,
t
);
return
;
rdst:
//
rdst:
// requires register destination
regalloc
(
&
r1
,
t
->
type
,
t
);
gins
(
a
,
f
,
&
r1
);
...
...
@@ -964,7 +965,7 @@ hard:
regfree
(
&
r1
);
return
;
hardmem:
//
hardmem:
// requires memory intermediate
tempalloc
(
&
r1
,
cvt
);
gmove
(
f
,
&
r1
);
...
...
@@ -1000,8 +1001,8 @@ samaddr(Node *f, Node *t)
Prog
*
gins
(
int
as
,
Node
*
f
,
Node
*
t
)
{
Node
nod
;
int32
v
;
//
Node nod;
//
int32 v;
Prog
*
p
;
if
(
f
!=
N
&&
f
->
op
==
OINDEX
)
{
...
...
@@ -1775,13 +1776,13 @@ lit:
// break;
// }
//
cleani += 2;
//
reg = &clean[cleani-1];
//
reg1 = &clean[cleani-2];
//
reg->op = OEMPTY;
//
reg1->op = OEMPTY;
//
naddr(n, a);
//
goto yes;
cleani
+=
2
;
reg
=
&
clean
[
cleani
-
1
];
reg1
=
&
clean
[
cleani
-
2
];
reg
->
op
=
OEMPTY
;
reg1
->
op
=
OEMPTY
;
naddr
(
n
,
a
);
goto
yes
;
odot:
o
=
dotoffset
(
n
,
oary
,
&
nn
);
...
...
src/cmd/5g/list.c
View file @
7a87a3e0
...
...
@@ -76,10 +76,10 @@ Pconv(Fmt *fp)
int
Dconv
(
Fmt
*
fp
)
{
char
str
[
100
],
s
[
100
];
char
str
[
100
]
;
//
, s[100];
Addr
*
a
;
int
i
;
uint32
d1
,
d2
;
//
uint32 d1, d2;
a
=
va_arg
(
fp
->
args
,
Addr
*
);
i
=
a
->
type
;
...
...
@@ -128,7 +128,7 @@ Dconv(Fmt *fp)
// a->type = D_ADDR;
// goto conv;
}
conv:
//
conv:
return
fmtstrcpy
(
fp
,
str
);
}
...
...
src/cmd/5l/obj.c
View file @
7a87a3e0
...
...
@@ -79,7 +79,6 @@ main(int argc, char *argv[])
char
*
a
;
Binit
(
&
bso
,
1
,
OWRITE
);
srand
(
time
(
0
));
cout
=
-
1
;
listinit
();
outfile
=
0
;
...
...
@@ -556,23 +555,13 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
break
;
case
D_SCONST
:
while
(
nhunk
<
NSNAME
)
gethunk
();
a
->
sval
=
(
char
*
)
hunk
;
nhunk
-=
NSNAME
;
hunk
+=
NSNAME
;
a
->
sval
=
mal
(
NSNAME
);
Bread
(
f
,
a
->
sval
,
NSNAME
);
c
+=
NSNAME
;
break
;
case
D_FCONST
:
while
(
nhunk
<
sizeof
(
Ieee
))
gethunk
();
a
->
ieee
=
(
Ieee
*
)
hunk
;
nhunk
-=
NSNAME
;
hunk
+=
NSNAME
;
a
->
ieee
=
mal
(
sizeof
(
Ieee
));
a
->
ieee
->
l
=
Bget4
(
f
);
a
->
ieee
->
h
=
Bget4
(
f
);
break
;
...
...
@@ -593,12 +582,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
return
;
}
while
(
nhunk
<
sizeof
(
Auto
))
gethunk
();
u
=
(
Auto
*
)
hunk
;
nhunk
-=
sizeof
(
Auto
);
hunk
+=
sizeof
(
Auto
);
u
=
mal
(
sizeof
(
Auto
));
u
->
link
=
curauto
;
curauto
=
u
;
u
->
asym
=
s
;
...
...
@@ -888,12 +872,7 @@ loop:
goto
loop
;
}
if
(
nhunk
<
sizeof
(
Prog
))
gethunk
();
p
=
(
Prog
*
)
hunk
;
nhunk
-=
sizeof
(
Prog
);
hunk
+=
sizeof
(
Prog
);
p
=
mal
(
sizeof
(
Prog
));
p
->
as
=
o
;
p
->
scond
=
Bgetc
(
f
);
p
->
reg
=
Bgetc
(
f
);
...
...
@@ -1229,12 +1208,7 @@ lookup(char *symb, int v)
if
(
memcmp
(
s
->
name
,
symb
,
l
)
==
0
)
return
s
;
while
(
nhunk
<
sizeof
(
Sym
))
gethunk
();
s
=
(
Sym
*
)
hunk
;
nhunk
-=
sizeof
(
Sym
);
hunk
+=
sizeof
(
Sym
);
s
=
mal
(
sizeof
(
Sym
));
s
->
name
=
malloc
(
l
);
memmove
(
s
->
name
,
symb
,
l
);
...
...
@@ -1254,38 +1228,11 @@ prg(void)
{
Prog
*
p
;
while
(
nhunk
<
sizeof
(
Prog
))
gethunk
();
p
=
(
Prog
*
)
hunk
;
nhunk
-=
sizeof
(
Prog
);
hunk
+=
sizeof
(
Prog
);
p
=
mal
(
sizeof
(
Prog
));
*
p
=
zprg
;
return
p
;
}
void
gethunk
(
void
)
{
char
*
h
;
int32
nh
;
nh
=
NHUNK
;
if
(
thunk
>=
5L
*
NHUNK
)
{
nh
=
5L
*
NHUNK
;
if
(
thunk
>=
25L
*
NHUNK
)
nh
=
25L
*
NHUNK
;
}
h
=
mysbrk
(
nh
);
if
(
h
==
(
char
*
)
-
1
)
{
diag
(
"out of memory"
);
errorexit
();
}
hunk
=
h
;
nhunk
=
nh
;
thunk
+=
nh
;
}
void
doprof1
(
void
)
{
...
...
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