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
9fa0af71
Commit
9fa0af71
authored
Jun 02, 1996
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(tablejump_internal3, tablejump_internal4): New patterns.
(tablejump): Use them for PIC code. From-SVN: r12139
parent
bca7cce2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
21 deletions
+65
-21
gcc/config/mips/mips.md
+65
-21
No files found.
gcc/config/mips/mips.md
View file @
9fa0af71
...
@@ -5869,10 +5869,20 @@ move\\t%0,%z4\\n\\
...
@@ -5869,10 +5869,20 @@ move\\t%0,%z4\\n\\
if (GET_MODE (operands[0]) != Pmode)
if (GET_MODE (operands[0]) != Pmode)
abort ();
abort ();
if (!TARGET_LONG64)
if (! flag_pic)
emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
{
if (!TARGET_LONG64)
emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
else
emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
}
else
else
emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
{
if (!TARGET_LONG64)
emit_jump_insn (gen_tablejump_internal3 (operands[0], operands[1]));
else
emit_jump_insn (gen_tablejump_internal4 (operands[0], operands[1]));
}
DONE;
DONE;
}
}
...
@@ -5883,39 +5893,73 @@ move\\t%0,%z4\\n\\
...
@@ -5883,39 +5893,73 @@ move\\t%0,%z4\\n\\
(match_operand:SI 0 "register_operand" "d"))
(match_operand:SI 0 "register_operand" "d"))
(use (label_ref (match_operand 1 "" "")))]
(use (label_ref (match_operand 1 "" "")))]
"!TARGET_LONG64"
"!TARGET_LONG64"
"*
"%*j\\t%0"
{
/* .cpadd expands to add REG,REG,$gp when pic, and nothing when not pic. */
if (TARGET_ABICALLS && mips_abi == ABI_32)
output_asm_insn (\".cpadd\\t%0\", operands);
return \"%*j\\t%0\";
}"
[(set_attr "type" "jump")
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "mode" "none")
(set (attr "length")
(set_attr "length" "1")])
(if_then_else (eq_attr "abicalls" "yes")
(const_int 2)
(const_int 1)))])
(define_insn "tablejump_internal2"
(define_insn "tablejump_internal2"
[(set (pc)
[(set (pc)
(match_operand:DI 0 "register_operand" "d"))
(match_operand:DI 0 "register_operand" "d"))
(use (label_ref (match_operand 1 "" "")))]
(use (label_ref (match_operand 1 "" "")))]
"TARGET_LONG64"
"TARGET_LONG64"
"%*j\\t%0"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "1")])
(define_expand "tablejump_internal3"
[(set (pc)
(plus:SI (match_operand:SI 0 "register_operand" "d")
(label_ref:SI (match_operand:SI 1 "" ""))))]
""
"")
;;; Make sure that this only matches the insn before ADDR_DIFF_VEC. Otherwise
;;; it is not valid.
;;; ??? The length depends on the ABI. It is two for o32, and one for n32.
;;; We just use the conservative number here.
(define_insn ""
[(set (pc)
(plus:SI (match_operand:SI 0 "register_operand" "d")
(label_ref:SI (match_operand:SI 1 "" ""))))]
"!TARGET_LONG64 && next_active_insn (insn) != 0
&& GET_CODE (PATTERN (next_active_insn (insn))) == ADDR_DIFF_VEC
&& PREV_INSN (next_active_insn (insn)) == operands[1]"
"*
"*
{
{
/* .cpdadd expands to dadd REG,REG,$gp when pic, and nothing when not pic. */
/* .cpadd expands to add REG,REG,$gp when pic, and nothing when not pic. */
/* ??? SGI as does not have a .cpdadd. */
if (mips_abi == ABI_32)
if (TARGET_ABICALLS && mips_abi == ABI_32)
output_asm_insn (\".cpadd\\t%0\", operands);
output_asm_insn (\".cpadd\\t%0\", operands);
return \"%*j\\t%0\";
return \"%*j\\t%0\";
}"
}"
[(set_attr "type" "jump")
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "mode" "none")
(set (attr "length")
(set_attr "length" "2")])
(if_then_else (eq_attr "abicalls" "yes")
(const_int 2)
(define_expand "tablejump_internal4"
(const_int 1)))])
[(set (pc)
(plus:DI (match_operand:DI 0 "register_operand" "d")
(label_ref:DI (match_operand:SI 1 "" ""))))]
""
"")
;;; Make sure that this only matches the insn before ADDR_DIFF_VEC. Otherwise
;;; it is not valid.
(define_insn ""
[(set (pc)
(plus:DI (match_operand:DI 0 "register_operand" "d")
(label_ref:DI (match_operand:SI 1 "" ""))))]
"!TARGET_LONG64 && next_active_insn (insn) != 0
&& GET_CODE (PATTERN (next_active_insn (insn))) == ADDR_DIFF_VEC
&& PREV_INSN (next_active_insn (insn)) == operands[1]"
"%*j\\t%0"
[(set_attr "type" "jump")
(set_attr "mode" "none")
(set_attr "length" "1")])
;; Function return, only allow after optimization, so that we can
;; Function return, only allow after optimization, so that we can
;; eliminate jumps to jumps if no stack space is used.
;; eliminate jumps to jumps if no stack space is used.
...
...
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