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
06b1198f
Commit
06b1198f
authored
Nov 12, 2012
by
Ian Bolton
Committed by
Ian Bolton
Nov 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CSINC instead of CSEL to return 1 (AArch64)
From-SVN: r193452
parent
f5313c63
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
8 deletions
+44
-8
gcc/ChangeLog
+8
-0
gcc/config/aarch64/aarch64.md
+10
-6
gcc/config/aarch64/constraints.md
+5
-0
gcc/config/aarch64/predicates.md
+3
-2
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.target/aarch64/csinc-2.c
+14
-0
No files found.
gcc/ChangeLog
View file @
06b1198f
2012
-
11
-
12
Ian
Bolton
<
ian
.
bolton
@arm
.
com
>
*
config
/
aarch64
/
aarch64
.
md
(
cmov
<
mode
>
_insn
)
:
Emit
CSINC
when
one
of
the
alternatives
is
constant
1
.
*
config
/
aarch64
/
constraints
.
md
:
New
constraint
.
*
config
/
aarch64
/
predicates
.
md
:
Rename
predicate
aarch64_reg_zero_or_m1
to
aarch64_reg_zero_or_m1_or_1
.
2012
-
11
-
12
Ian
Bolton
<
ian
.
bolton
@arm
.
com
>
*
config
/
aarch64
/
aarch64
.
md
(
*
compare_neg
<
mode
>
)
:
New
pattern
.
2012
-
11
-
12
Tobias
Burnus
<
burnus
@net
-
b
.
de
>
gcc/config/aarch64/aarch64.md
View file @
06b1198f
...
...
@@ -1885,19 +1885,23 @@
)
(define_insn "
*
cmov
<mode>
_insn"
[
(set (match_operand:ALLI 0 "register_operand" "=r,r,r,r")
[
(set (match_operand:ALLI 0 "register_operand" "=r,r,r,r
,r,r,r
")
(if_then_else:ALLI
(match_operator 1 "aarch64_comparison_operator"
[
(match_operand 2 "cc_register" "") (const_int 0)
]
)
(match_operand:ALLI 3 "aarch64_reg_zero_or_m1" "rZ,rZ,UsM,UsM")
(match_operand:ALLI 4 "aarch64_reg_zero_or_m1" "rZ,UsM,rZ,UsM")))]
""
;; Final alternative should be unreachable, but included for completeness
(match_operand:ALLI 3 "aarch64_reg_zero_or_m1_or_1" "rZ,rZ,UsM,rZ,Ui1,UsM,Ui1")
(match_operand:ALLI 4 "aarch64_reg_zero_or_m1_or_1" "rZ,UsM,rZ,Ui1,rZ,UsM,Ui1")))]
"!((operands
[
3
]
== const1_rtx && operands
[
4
]
== constm1_rtx)
|| (operands
[
3
]
== constm1_rtx && operands
[
4
]
== const1_rtx))"
;; Final two alternatives should be unreachable, but included for completeness
"@
csel
\\
t%
<w>
0, %
<w>
3, %
<w>
4, %m1
csinv
\\
t%
<w>
0, %
<w>
3,
<w>
zr, %m1
csinv
\\
t%
<w>
0, %
<w>
4,
<w>
zr, %M1
mov
\\
t%
<w>
0, -1"
csinc
\\
t%
<w>
0, %
<w>
3,
<w>
zr, %m1
csinc
\\
t%
<w>
0, %
<w>
4,
<w>
zr, %M1
mov
\\
t%
<w>
0, -1
mov
\\
t%
<w>
0, 1"
[
(set_attr "v8type" "csel")
(set_attr "mode" "
<MODE>
")]
)
...
...
gcc/config/aarch64/constraints.md
View file @
06b1198f
...
...
@@ -102,6 +102,11 @@
A constraint that matches the immediate constant -1."
(match_test "op == constm1_rtx"))
(define_constraint "Ui1"
"@internal
A constraint that matches the immediate constant +1."
(match_test "op == const1_rtx"))
(define_constraint "Ui3"
"@internal
A constraint that matches the integers 0...4."
...
...
gcc/config/aarch64/predicates.md
View file @
06b1198f
...
...
@@ -31,11 +31,12 @@
(ior (match_operand 0 "register_operand")
(match_test "op == const0_rtx"))))
(define_predicate "aarch64_reg_zero_or_m1"
(define_predicate "aarch64_reg_zero_or_m1
_or_1
"
(and (match_code "reg,subreg,const_int")
(ior (match_operand 0 "register_operand")
(ior (match_test "op == const0_rtx")
(match_test "op == constm1_rtx")))))
(ior (match_test "op == constm1_rtx")
(match_test "op == const1_rtx"))))))
(define_predicate "aarch64_fp_compare_operand"
(ior (match_operand 0 "register_operand")
...
...
gcc/testsuite/ChangeLog
View file @
06b1198f
2012-11-12 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/csinc-2.c: New test.
2012-11-12 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/cmn.c: New test.
* gcc.target/aarch64/adds.c: New test.
* gcc.target/aarch64/subs.c: New test.
...
...
gcc/testsuite/gcc.target/aarch64/csinc-2.c
0 → 100644
View file @
06b1198f
/* { dg-do compile } */
/* { dg-options "-O2" } */
int
foo
(
int
a
,
int
b
)
{
return
(
a
<
b
)
?
1
:
7
;
/* { dg-final { scan-assembler "csinc\tw\[0-9\].*wzr" } } */
}
typedef
long
long
s64
;
s64
foo2
(
s64
a
,
s64
b
)
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