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
6be6462e
Commit
6be6462e
authored
Jun 11, 2009
by
Anthony Green
Committed by
Anthony Green
Jun 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PC-relative branch support to Moxie port.
From-SVN: r148390
parent
4ec80803
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
14 deletions
+45
-14
gcc/ChangeLog
+9
-0
gcc/config/moxie/moxie.h
+2
-0
gcc/config/moxie/moxie.md
+34
-14
No files found.
gcc/ChangeLog
View file @
6be6462e
2009-06-11 Anthony Green <green@moxielogic.com>
* config/moxie/moxie.md: Define length attribute for all
instructions.
(rCC): Define.
(*b<cond:code>): Support limited branch ranges for new PC-relative
branch instructions.
* config/moxie/moxie.h (HAS_LONG_UNCOND_BRANCH): Define.
2009-06-11 Jakub Jelinek <jakub@redhat.com>
2009-06-11 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (min_insn_size): Use get_attr_length
* config/i386/i386.c (min_insn_size): Use get_attr_length
...
...
gcc/config/moxie/moxie.h
View file @
6be6462e
...
@@ -571,4 +571,6 @@ do \
...
@@ -571,4 +571,6 @@ do \
builtin_define_std ("MOXIE"); \
builtin_define_std ("MOXIE"); \
}
}
#define HAS_LONG_UNCOND_BRANCH true
#endif
/* GCC_MOXIE_H */
#endif
/* GCC_MOXIE_H */
gcc/config/moxie/moxie.md
View file @
6be6462e
...
@@ -19,12 +19,15 @@
...
@@ -19,12 +19,15 @@
;;
<http://www.gnu.org/licenses/>
.
;;
<http://www.gnu.org/licenses/>
.
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
;; Moxie specific constraints
;; Moxie specific constraints
, predicates and attributes
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
(include "constraints.md")
(include "constraints.md")
(include "predicates.md")
(include "predicates.md")
; Most instructions are two bytes long.
(define_attr "length" "" (const_int 2))
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
;; nop instruction
;; nop instruction
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
...
@@ -232,7 +235,8 @@
...
@@ -232,7 +235,8 @@
ld.l %0, %1
ld.l %0, %1
lda.l %0, %1
lda.l %0, %1
sto.l %0, %1
sto.l %0, %1
ldo.l %0, %1")
ldo.l %0, %1"
[
(set_attr "length" "2,6,2,6,2,6,6,6")
]
)
(define_expand "movqi"
(define_expand "movqi"
[
(set (match_operand:QI 0 "general_operand" "")
[
(set (match_operand:QI 0 "general_operand" "")
...
@@ -258,7 +262,8 @@
...
@@ -258,7 +262,8 @@
ld.b %0, %1
ld.b %0, %1
lda.b %0, %1
lda.b %0, %1
sto.b %0, %1
sto.b %0, %1
ldo.b %0, %1")
ldo.b %0, %1"
[
(set_attr "length" "2,6,2,6,2,6,6,6")
]
)
(define_expand "movhi"
(define_expand "movhi"
[
(set (match_operand:HI 0 "general_operand" "")
[
(set (match_operand:HI 0 "general_operand" "")
...
@@ -284,7 +289,8 @@
...
@@ -284,7 +289,8 @@
ld.s %0, %1
ld.s %0, %1
lda.s %0, %1
lda.s %0, %1
sto.s %0, %1
sto.s %0, %1
ldo.s %0, %1")
ldo.s %0, %1"
[
(set_attr "length" "2,6,2,6,2,6,6,6")
]
)
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
;; Compare instructions
;; Compare instructions
...
@@ -305,12 +311,12 @@
...
@@ -305,12 +311,12 @@
(pc)))]
(pc)))]
""
""
"
"
/
* Force the compare operands into registers. *
/
/
* Force the compare operands into registers. *
/
if (GET_CODE (operands
[
1
]
) != REG)
if (GET_CODE (operands
[
1
]
) != REG)
operands
[
1
]
= force_reg (SImode, operands
[
1
]
);
operands
[
1
]
= force_reg (SImode, operands
[
1
]
);
if (GET_CODE (operands
[
2
]
) != REG)
if (GET_CODE (operands
[
2
]
) != REG)
operands
[
2
]
= force_reg (SImode, operands
[
2
]
);
operands
[
2
]
= force_reg (SImode, operands
[
2
]
);
")
")
(define_insn "
*
cmpsi"
(define_insn "
*
cmpsi"
[
(set (reg:CC CC_REG)
[
(set (reg:CC CC_REG)
...
@@ -329,6 +335,9 @@ if (GET_CODE (operands[2]) != REG)
...
@@ -329,6 +335,9 @@ if (GET_CODE (operands[2]) != REG)
(define_code_attr CC
[
(ne "ne") (eq "eq") (lt "lt") (ltu "ltu")
(define_code_attr CC
[
(ne "ne") (eq "eq") (lt "lt") (ltu "ltu")
(gt "gt") (gtu "gtu") (ge "ge") (le "le")
(gt "gt") (gtu "gtu") (ge "ge") (le "le")
(geu "geu") (leu "leu") ])
(geu "geu") (leu "leu") ])
(define_code_attr rCC
[
(ne "eq") (eq "ne") (lt "ge") (ltu "geu")
(gt "le") (gtu "leu") (ge "lt") (le "gt")
(geu "ltu") (leu "gtu") ])
(define_insn "
*
b
<cond:code>
"
(define_insn "
*
b
<cond:code>
"
[
(set (pc)
[
(set (pc)
...
@@ -337,7 +346,15 @@ if (GET_CODE (operands[2]) != REG)
...
@@ -337,7 +346,15 @@ if (GET_CODE (operands[2]) != REG)
(label_ref (match_operand 0 "" ""))
(label_ref (match_operand 0 "" ""))
(pc)))]
(pc)))]
""
""
"b
<CC>
%l0")
{
if (get_attr_length (insn) == 2)
return "b
<CC>
%l0";
else
return "b
<rCC>
.+6
\n\t
jmpa %l0";
}
[
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 1022))
(const_int 2) (const_int 8)))])
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
;; Call and Jump instructions
;; Call and Jump instructions
...
@@ -358,7 +375,8 @@ if (GET_CODE (operands[2]) != REG)
...
@@ -358,7 +375,8 @@ if (GET_CODE (operands[2]) != REG)
""
""
"@
"@
jsra %0
jsra %0
jsr %0")
jsr %0"
[
(set_attr "length" "6,2")
]
)
(define_expand "call_value"
(define_expand "call_value"
[
(set (match_operand 0 "" "")
[
(set (match_operand 0 "" "")
...
@@ -375,7 +393,8 @@ if (GET_CODE (operands[2]) != REG)
...
@@ -375,7 +393,8 @@ if (GET_CODE (operands[2]) != REG)
1 "immediate_operand" "i"))
1 "immediate_operand" "i"))
(match_operand 2 "" "")))]
(match_operand 2 "" "")))]
""
""
"jsra %1")
"jsra %1"
[
(set_attr "length" "6")
]
)
(define_insn "
*
call_value_indirect"
(define_insn "
*
call_value_indirect"
[
(set (match_operand 0 "register_operand" "=r")
[
(set (match_operand 0 "register_operand" "=r")
...
@@ -394,7 +413,8 @@ if (GET_CODE (operands[2]) != REG)
...
@@ -394,7 +413,8 @@ if (GET_CODE (operands[2]) != REG)
[
(set (pc)
[
(set (pc)
(label_ref (match_operand 0 "" "")))]
(label_ref (match_operand 0 "" "")))]
""
""
"jmpa %l0")
"jmpa %l0"
[
(set_attr "length" "6")
]
)
;; -------------------------------------------------------------------------
;; -------------------------------------------------------------------------
...
...
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