Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
9ee3c687
Commit
9ee3c687
authored
Apr 21, 1997
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(output_addsi3): New function. From addsi3 pattern.
From-SVN: r13952
parent
079e639f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
gcc/config/m68k/m68k.c
+91
-0
No files found.
gcc/config/m68k/m68k.c
View file @
9ee3c687
...
@@ -1952,6 +1952,97 @@ find_addr_reg (addr)
...
@@ -1952,6 +1952,97 @@ find_addr_reg (addr)
abort
();
abort
();
}
}
/* Output assembler code to perform a 32 bit 3 operand add. */
char
*
output_addsi3
(
operands
)
rtx
*
operands
;
{
if
(
!
operands_match_p
(
operands
[
0
],
operands
[
1
]))
{
if
(
!
ADDRESS_REG_P
(
operands
[
1
]))
{
rtx
tmp
=
operands
[
1
];
operands
[
1
]
=
operands
[
2
];
operands
[
2
]
=
tmp
;
}
/* These insns can result from reloads to access
stack slots over 64k from the frame pointer. */
if
(
GET_CODE
(
operands
[
2
])
==
CONST_INT
&&
INTVAL
(
operands
[
2
])
+
0x8000
>=
(
unsigned
)
0x10000
)
return
"move%.l %2,%0
\\
;add%.l %1,%0"
;
#ifdef SGS
if
(
GET_CODE
(
operands
[
2
])
==
REG
)
return
"lea 0(%1,%2.l),%0"
;
else
return
"lea %c2(%1),%0"
;
#else
/* not SGS */
#ifdef MOTOROLA
if
(
GET_CODE
(
operands
[
2
])
==
REG
)
return
"lea (%1,%2.l),%0"
;
else
return
"lea (%c2,%1),%0"
;
#else
/* not MOTOROLA (MIT syntax) */
if
(
GET_CODE
(
operands
[
2
])
==
REG
)
return
"lea %1@(0,%2:l),%0"
;
else
return
"lea %1@(%c2),%0"
;
#endif
/* not MOTOROLA */
#endif
/* not SGS */
}
if
(
GET_CODE
(
operands
[
2
])
==
CONST_INT
)
{
#ifndef NO_ADDSUB_Q
if
(
INTVAL
(
operands
[
2
])
>
0
&&
INTVAL
(
operands
[
2
])
<=
8
)
return
"addq%.l %2,%0"
;
if
(
INTVAL
(
operands
[
2
])
<
0
&&
INTVAL
(
operands
[
2
])
>=
-
8
)
{
operands
[
2
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
-
INTVAL
(
operands
[
2
]));
return
"subq%.l %2,%0"
;
}
/* On the CPU32 it is faster to use two addql instructions to
add a small integer (8 < N <= 16) to a register.
Likewise for subql. */
if
(
TARGET_CPU32
&&
REG_P
(
operands
[
0
]))
{
if
(
INTVAL
(
operands
[
2
])
>
8
&&
INTVAL
(
operands
[
2
])
<=
16
)
{
operands
[
2
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
INTVAL
(
operands
[
2
])
-
8
);
return
"addq%.l %#8,%0
\\
;addq%.l %2,%0"
;
}
if
(
INTVAL
(
operands
[
2
])
<
-
8
&&
INTVAL
(
operands
[
2
])
>=
-
16
)
{
operands
[
2
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
-
INTVAL
(
operands
[
2
])
-
8
);
return
"subq%.l %#8,%0
\\
;subq%.l %2,%0"
;
}
}
#endif
if
(
ADDRESS_REG_P
(
operands
[
0
])
&&
INTVAL
(
operands
[
2
])
>=
-
0x8000
&&
INTVAL
(
operands
[
2
])
<
0x8000
)
{
if
(
TARGET_68040
)
return
"add%.w %2,%0"
;
else
#ifdef MOTOROLA
return
"lea (%c2,%0),%0"
;
#else
return
"lea %0@(%c2),%0"
;
#endif
}
}
return
"add%.l %2,%0"
;
}
/* Store in cc_status the expressions that the condition codes will
/* Store in cc_status the expressions that the condition codes will
describe after execution of an instruction whose pattern is EXP.
describe after execution of an instruction whose pattern is EXP.
Do not alter them if the instruction would not alter the cc's. */
Do not alter them if the instruction would not alter the cc's. */
...
...
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