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
5080d761
Commit
5080d761
authored
Feb 09, 2011
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgen64: dont use MVN instruction
R=r CC=golang-dev
https://golang.org/cl/4154043
parent
dc331e65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
cgen64.c
src/cmd/5g/cgen64.c
+6
-2
peep.c
src/cmd/5g/peep.c
+18
-18
No files found.
src/cmd/5g/cgen64.c
View file @
5080d761
...
...
@@ -64,17 +64,21 @@ cgen64(Node *n, Node *res)
return
;
case
OCOM
:
regalloc
(
&
t1
,
lo1
.
type
,
N
);
gmove
(
ncon
(
-
1
),
&
t1
);
split64
(
res
,
&
lo2
,
&
hi2
);
regalloc
(
&
n1
,
lo1
.
type
,
N
);
gins
(
AMOVW
,
&
lo1
,
&
n1
);
gins
(
A
MVN
,
&
n
1
,
&
n1
);
gins
(
A
EOR
,
&
t
1
,
&
n1
);
gins
(
AMOVW
,
&
n1
,
&
lo2
);
gins
(
AMOVW
,
&
hi1
,
&
n1
);
gins
(
A
MVN
,
&
n
1
,
&
n1
);
gins
(
A
EOR
,
&
t
1
,
&
n1
);
gins
(
AMOVW
,
&
n1
,
&
hi2
);
regfree
(
&
t1
);
regfree
(
&
n1
);
splitclean
();
splitclean
();
...
...
src/cmd/5g/peep.c
View file @
5080d761
...
...
@@ -133,20 +133,20 @@ loop1:
switch
(
p
->
as
)
{
default:
continue
;
case
AEOR
:
/*
* EOR -1,x,y => MVN x,y
*/
if
(
isdconst
(
&
p
->
from
)
&&
p
->
from
.
offset
==
-
1
)
{
p
->
as
=
AMVN
;
p
->
from
.
type
=
D_REG
;
if
(
p
->
reg
!=
NREG
)
p
->
from
.
reg
=
p
->
reg
;
else
p
->
from
.
reg
=
p
->
to
.
reg
;
p
->
reg
=
NREG
;
}
continue
;
//
case AEOR:
//
/*
//
* EOR -1,x,y => MVN x,y
//
*/
//
if(isdconst(&p->from) && p->from.offset == -1) {
//
p->as = AMVN;
//
p->from.type = D_REG;
//
if(p->reg != NREG)
//
p->from.reg = p->reg;
//
else
//
p->from.reg = p->to.reg;
//
p->reg = NREG;
//
}
//
continue;
case
AMOVH
:
case
AMOVHU
:
case
AMOVB
:
...
...
@@ -337,7 +337,7 @@ subprop(Reg *r0)
case
AMULLU
:
case
AMULA
:
case
AMVN
:
//
case AMVN:
case
ACMN
:
case
AADD
:
...
...
@@ -666,7 +666,7 @@ shiftprop(Reg *r)
FAIL
(
"can't swap"
);
if
(
p1
->
reg
==
NREG
&&
p1
->
to
.
reg
==
n
)
FAIL
(
"shift result used twice"
);
case
AMVN
:
//
case AMVN:
if
(
p1
->
from
.
type
==
D_SHIFT
)
FAIL
(
"shift result used in shift"
);
if
(
p1
->
from
.
type
!=
D_REG
||
p1
->
from
.
reg
!=
n
)
...
...
@@ -1018,7 +1018,7 @@ copyu(Prog *p, Adr *v, Adr *s)
case
AMULLU
:
/* read, read, write, write */
case
AMULA
:
case
AMVN
:
//
case AMVN:
return
2
;
case
AADD
:
/* read, read, write */
...
...
@@ -1176,7 +1176,7 @@ a2type(Prog *p)
case
AORR
:
case
AAND
:
case
AEOR
:
case
AMVN
:
//
case AMVN:
case
AMUL
:
case
AMULU
:
case
ADIV
:
...
...
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