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
923d093a
Commit
923d093a
authored
Dec 24, 2014
by
Anthony Green
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mul.x support for moxie
From-SVN: r219056
parent
36e87c23
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
10 deletions
+53
-10
gcc/config/moxie/moxie.c
+5
-2
gcc/config/moxie/moxie.md
+36
-7
gcc/config/moxie/moxie.opt
+4
-0
gcc/config/moxie/moxiebox.h
+2
-0
gcc/doc/invoke.texi
+6
-1
No files found.
gcc/config/moxie/moxie.c
View file @
923d093a
...
...
@@ -249,13 +249,16 @@ moxie_init_machine_status (void)
}
/* The TARGET_OPTION_OVERRIDE worker.
All this curently does is set init_machine_status. */
/* The TARGET_OPTION_OVERRIDE worker. */
static
void
moxie_option_override
(
void
)
{
/* Set the per-function-data initializer. */
init_machine_status
=
moxie_init_machine_status
;
#ifdef TARGET_MOXIEBOX
target_flags
&=
~
MASK_HAS_MULX
;
#endif
}
/* Compute the size of the local area and the size to be adjusted by the
...
...
gcc/config/moxie/moxie.md
View file @
923d093a
...
...
@@ -50,7 +50,7 @@
"@
inc %0, %2
dec %0, -%2
add
.l
%0, %2")
add
%0, %2")
(define_insn "subsi3"
[
(set (match_operand:SI 0 "register_operand" "=r,r")
...
...
@@ -60,7 +60,7 @@
""
"@
dec %0, %2
sub
.l
%0, %2")
sub
%0, %2")
(define_insn "mulsi3"
[
(set (match_operand:SI 0 "register_operand" "=r")
...
...
@@ -68,7 +68,36 @@
(match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"mul.l %0, %2")
"mul %0, %2")
(define_code_iterator EXTEND
[
sign_extend zero_extend
]
)
(define_code_attr mul
[
(sign_extend "mul") (zero_extend "umul")
]
)
(define_insn "
<mul>
si3_highpart"
[
(set (match_operand:SI 0 "register_operand" "=r")
(truncate:SI
(lshiftrt:DI
(mult:DI (EXTEND:DI (match_operand:SI 1 "register_operand" "0"))
(EXTEND:DI (match_operand:SI 2 "register_operand" "r")))
(const_int 32))))]
"TARGET_HAS_MULX"
"
<mul>
.x
\\
t%0, %2")
(define_expand "
<mul>
sidi3"
[
(set (match_operand:DI 0 "register_operand" "")
(mult:DI (EXTEND:DI (match_operand:SI 1 "register_operand" "0"))
(EXTEND:DI (match_operand:SI 2 "register_operand" "r"))))]
"TARGET_HAS_MULX"
{
rtx hi = gen_reg_rtx (SImode);
rtx lo = gen_reg_rtx (SImode);
emit_insn (gen_
<mul>
si3_highpart (hi, operands
[
1
]
, operands
[
2
]
));
emit_insn (gen_mulsi3 (lo, operands
[
1
]
, operands
[
2
]
));
emit_move_insn (gen_lowpart (SImode, operands
[
0
]
), lo);
emit_move_insn (gen_highpart (SImode, operands
[
0
]
), hi);
DONE;
})
(define_insn "divsi3"
[
(set (match_operand:SI 0 "register_operand" "=r")
...
...
@@ -76,7 +105,7 @@
(match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"div
.l
%0, %2")
"div
%0, %2")
(define_insn "udivsi3"
[
(set (match_operand:SI 0 "register_operand" "=r")
...
...
@@ -84,7 +113,7 @@
(match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"udiv
.l
%0, %2")
"udiv
%0, %2")
(define_insn "modsi3"
[
(set (match_operand:SI 0 "register_operand" "=r")
...
...
@@ -92,7 +121,7 @@
(match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"mod
.l
%0, %2")
"mod
%0, %2")
(define_insn "umodsi3"
[
(set (match_operand:SI 0 "register_operand" "=r")
...
...
@@ -100,7 +129,7 @@
(match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
""
"umod
.l
%0, %2")
"umod
%0, %2")
;; -------------------------------------------------------------------------
;; Unary arithmetic instructions
...
...
gcc/config/moxie/moxie.opt
View file @
923d093a
...
...
@@ -26,6 +26,10 @@ mel
Target RejectNegative Report Mask(LITTLE_ENDIAN)
Generate little-endian code
mmul.x
Target Report Mask(HAS_MULX)
Enable MUL.X and UMUL.X instructions
; Ignored by the compiler
mno-crt0
Target RejectNegative
gcc/config/moxie/moxiebox.h
View file @
923d093a
...
...
@@ -45,3 +45,5 @@ along with GCC; see the file COPYING3. If not see
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
#define TARGET_MOXIEBOX
gcc/doc/invoke.texi
View file @
923d093a
...
...
@@ -843,7 +843,7 @@ Objective-C and Objective-C++ Dialects}.
-
mno
-
crt0
-
mrelax
-
mliw
-
msetlb
}
@
emph
{
Moxie
Options
}
@
gccoptlist
{-
meb
-
mel
-
mno
-
crt0
}
@
gccoptlist
{-
meb
-
mel
-
m
mul
.
x
-
m
no
-
crt0
}
@
emph
{
MSP430
Options
}
@
gccoptlist
{-
msim
-
masm
-
hex
-
mmcu
=
-
mcpu
=
-
mlarge
-
msmall
-
mrelax
@
gol
...
...
@@ -18854,6 +18854,11 @@ configurations.
@
opindex
mel
Generate
little
-
endian
code
.
@
item
-
mmul
.
x
@
opindex
mmul
.
x
Generate
mul
.
x
and
umul
.
x
instructions
.
This
is
the
default
for
@
samp
{
moxiebox
-*-*}
configurations
.
@
item
-
mno
-
crt0
@
opindex
mno
-
crt0
Do
not
link
in
the
C
run
-
time
initialization
object
file
.
...
...
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