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
d5214afa
Commit
d5214afa
authored
Nov 08, 2010
by
Paul Koning
Committed by
Paul Koning
Nov 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* config/pdp11/pdp11.md (lshrsi3, lshrhi3): Fix wrong code.
From-SVN: r166468
parent
8860adf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
9 deletions
+65
-9
gcc/ChangeLog
+4
-0
gcc/config/pdp11/pdp11.md
+61
-9
No files found.
gcc/ChangeLog
View file @
d5214afa
2010
-
11
-
08
Paul
Koning
<
ni1d
@arrl
.
net
>
*
config
/
pdp11
/
pdp11
.
md
(
lshrsi3
,
lshrhi3
)
:
Fix
wrong
code
.
2010
-
11
-
08
Paul
Koning
<
ni1d
@arrl
.
net
>
*
config
/
pdp11
/
pdp11
.
md
(
negsi2
)
:
Fix
wrong
code
.
2010
-
11
-
08
Paul
Koning
<
ni1d
@arrl
.
net
>
gcc/config/pdp11/pdp11.md
View file @
d5214afa
...
...
@@ -849,7 +849,7 @@
[
(set_attr "length" "2,4")
]
)
;; lsr
(define_insn ""
(define_insn "
lsrhi1
"
[
(set (match_operand:HI 0 "nonimmediate_operand" "=rR,Q")
(lshiftrt:HI (match_operand:HI 1 "general_operand" "0,0")
(const_int 1)))]
...
...
@@ -857,7 +857,7 @@
"clc
\;
ror %0"
[
(set_attr "length" "2,4")
]
)
(define_insn "ls
hrsi3
"
(define_insn "ls
rsi1
"
[
(set (match_operand:SI 0 "register_operand" "=r")
(lshiftrt:SI (match_operand:SI 1 "general_operand" "0")
(const_int 1)))]
...
...
@@ -880,6 +880,36 @@
}
[
(set_attr "length" "10")
]
)
(define_expand "lshrsi3"
[
(match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "")]
""
"
{
rtx r;
if (!TARGET_40_PLUS &&
(GET_CODE (operands
[
2
]
) != CONST_INT ||
(unsigned) INTVAL (operands
[
2
]
) > 3))
FAIL;
emit_insn (gen_lsrsi1 (operands
[
0
]
, operands
[
1
]
));
if (GET_CODE (operands
[
2
]
) != CONST_INT)
{
r = gen_reg_rtx (HImode);
emit_insn (gen_subhi3 (r, operands
[
2
]
, GEN_INT (1)));
emit_insn (gen_ashrsi3 (operands
[
0
]
, operands
[
0
]
, r));
}
else if ((unsigned) INTVAL (operands
[
2
]
) != 1)
{
emit_insn (gen_ashlsi3 (operands
[
0
]
, operands
[
0
]
,
GEN_INT (1 - INTVAL (operands
[
2
]
))));
}
DONE;
}
"
)
;; shift is by arbitrary count is expensive,
;; shift by one cheap - so let's do that, if
;; space doesn't matter
...
...
@@ -996,13 +1026,35 @@
operands
[
2
]
= negate_rtx (HImode, operands
[
2
]
);
}")
;;;;- logical shift instructions
;;(define_insn "lshrsi3"
;;
[
(set (match_operand:HI 0 "register_operand" "=r")
;; (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
;; (match_operand:HI 2 "general_operand" "rI")))]
;; ""
;; "srl %0,%2")
(define_expand "lshrhi3"
[
(match_operand:HI 0 "register_operand" "")
(match_operand:HI 1 "register_operand" "")
(match_operand:HI 2 "general_operand" "")]
""
"
{
rtx r;
if (!TARGET_40_PLUS &&
(GET_CODE (operands
[
2
]
) != CONST_INT ||
(unsigned) INTVAL (operands
[
2
]
) > 3))
FAIL;
emit_insn (gen_lsrhi1 (operands
[
0
]
, operands
[
1
]
));
if (GET_CODE (operands
[
2
]
) != CONST_INT)
{
r = gen_reg_rtx (HImode);
emit_insn (gen_subhi3 (r, operands
[
2
]
, GEN_INT (1)));
emit_insn (gen_ashrhi3 (operands
[
0
]
, operands
[
0
]
, r));
}
else if ((unsigned) INTVAL (operands
[
2
]
) != 1)
{
emit_insn (gen_ashlhi3 (operands
[
0
]
, operands
[
0
]
,
GEN_INT (1 - INTVAL (operands
[
2
]
))));
}
DONE;
}
"
)
;; absolute
...
...
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