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
26366d28
Commit
26366d28
authored
Jul 02, 2013
by
Ian Bolton
Committed by
Ian Bolton
Jul 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AArch64 Support abs standard pattern for DI mode
From-SVN: r200596
parent
2879bb2b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
0 deletions
+94
-0
gcc/ChangeLog
+5
-0
gcc/config/aarch64/aarch64.md
+32
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.target/aarch64/abs_1.c
+53
-0
No files found.
gcc/ChangeLog
View file @
26366d28
2013-07-02 Ian Bolton <ian.bolton@arm.com>
* config/aarch64/aarch64-simd.md (absdi2): Support abs for
DI mode.
2013-07-02 Ian Bolton <ian.bolton@arm.com>
* config/aarch64/aarch64.md (*extr_insv_reg<mode>): New pattern.
2013-07-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
...
...
gcc/config/aarch64/aarch64.md
View file @
26366d28
...
...
@@ -2003,6 +2003,38 @@
(set_attr "mode" "SI")]
)
(define_insn_and_split "absdi2"
[
(set (match_operand:DI 0 "register_operand" "=r,w")
(abs:DI (match_operand:DI 1 "register_operand" "r,w")))
(clobber (match_scratch:DI 2 "=&r,X"))]
""
"@
#
abs
\\
t%d0, %d1"
"reload_completed
&& GP_REGNUM_P (REGNO (operands
[
0
]
))
&& GP_REGNUM_P (REGNO (operands
[
1
]
))"
[
(const_int 0)
]
{
emit_insn (gen_rtx_SET (VOIDmode, operands
[
2
]
,
gen_rtx_XOR (DImode,
gen_rtx_ASHIFTRT (DImode,
operands
[
1
]
,
GEN_INT (63)),
operands
[
1
]
)));
emit_insn (gen_rtx_SET (VOIDmode,
operands
[
0
]
,
gen_rtx_MINUS (DImode,
operands
[
2
]
,
gen_rtx_ASHIFTRT (DImode,
operands
[
1
]
,
GEN_INT (63)))));
DONE;
}
[
(set_attr "v8type" "alu")
(set_attr "mode" "DI")]
)
(define_insn "neg
<mode>
2"
[
(set (match_operand:GPI 0 "register_operand" "=r")
(neg:GPI (match_operand:GPI 1 "register_operand" "r")))]
...
...
gcc/testsuite/ChangeLog
View file @
26366d28
2013-07-02 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/abs_1.c: New test.
2013-07-02 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/bfxil_1.c: New test.
* gcc.target/aarch64/bfxil_2.c: Likewise.
...
...
gcc/testsuite/gcc.target/aarch64/abs_1.c
0 → 100644
View file @
26366d28
/* { dg-do run } */
/* { dg-options "-O2 -fno-inline --save-temps" } */
extern
long
long
llabs
(
long
long
);
extern
void
abort
(
void
);
long
long
abs64
(
long
long
a
)
{
/* { dg-final { scan-assembler "eor\t" } } */
/* { dg-final { scan-assembler "sub\t" } } */
return
llabs
(
a
);
}
long
long
abs64_in_dreg
(
long
long
a
)
{
/* { dg-final { scan-assembler "abs\td\[0-9\]+, d\[0-9\]+" } } */
register
long
long
x
asm
(
"d8"
)
=
a
;
register
long
long
y
asm
(
"d9"
);
asm
volatile
(
""
:
:
"w"
(
x
));
y
=
llabs
(
x
);
asm
volatile
(
""
:
:
"w"
(
y
));
return
y
;
}
int
main
(
void
)
{
volatile
long
long
ll0
=
0LL
,
ll1
=
1LL
,
llm1
=
-
1LL
;
if
(
abs64
(
ll0
)
!=
0LL
)
abort
();
if
(
abs64
(
ll1
)
!=
1LL
)
abort
();
if
(
abs64
(
llm1
)
!=
1LL
)
abort
();
if
(
abs64_in_dreg
(
ll0
)
!=
0LL
)
abort
();
if
(
abs64_in_dreg
(
ll1
)
!=
1LL
)
abort
();
if
(
abs64_in_dreg
(
llm1
)
!=
1LL
)
abort
();
return
0
;
}
/* { dg-final { cleanup-saved-temps } } */
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