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
93b826f0
Commit
93b826f0
authored
Mar 09, 2011
by
Michael Meissner
Committed by
Michael Meissner
Mar 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PR 47755 fallout
From-SVN: r170802
parent
84fdf81b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
179 additions
and
2 deletions
+179
-2
gcc/ChangeLog
+7
-0
gcc/config/rs6000/rs6000.c
+33
-2
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/gcc.target/powerpc/pr47755-2.c
+134
-0
No files found.
gcc/ChangeLog
View file @
93b826f0
2011-03-08 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/47755
* config/rs6000/rs6000.c (easy_altivec_constant): Correctly handle
V2DI/V2DF constants. Only all 0's or all 1's are easy.
(output_vec_const_move): Ditto.
2011-03-08 Anatoly Sokolov <aesok@post.ru>
2011-03-08 Anatoly Sokolov <aesok@post.ru>
* config/mips/mips.h (PREFERRED_RELOAD_CLASS): Remove macro.
* config/mips/mips.h (PREFERRED_RELOAD_CLASS): Remove macro.
...
...
gcc/config/rs6000/rs6000.c
View file @
93b826f0
...
@@ -4946,6 +4946,29 @@ easy_altivec_constant (rtx op, enum machine_mode mode)
...
@@ -4946,6 +4946,29 @@ easy_altivec_constant (rtx op, enum machine_mode mode)
else
if
(
mode
!=
GET_MODE
(
op
))
else
if
(
mode
!=
GET_MODE
(
op
))
return
false
;
return
false
;
/* V2DI/V2DF was added with VSX. Only allow 0 and all 1's as easy
constants. */
if
(
mode
==
V2DFmode
)
return
zero_constant
(
op
,
mode
);
if
(
mode
==
V2DImode
)
{
/* In case the compiler is built 32-bit, CONST_DOUBLE constants are not
easy. */
if
(
GET_CODE
(
CONST_VECTOR_ELT
(
op
,
0
))
!=
CONST_INT
||
GET_CODE
(
CONST_VECTOR_ELT
(
op
,
1
))
!=
CONST_INT
)
return
false
;
if
(
zero_constant
(
op
,
mode
))
return
true
;
if
(
INTVAL
(
CONST_VECTOR_ELT
(
op
,
0
))
==
-
1
&&
INTVAL
(
CONST_VECTOR_ELT
(
op
,
1
))
==
-
1
)
return
true
;
return
false
;
}
/* Start with a vspltisw. */
/* Start with a vspltisw. */
step
=
GET_MODE_NUNITS
(
mode
)
/
4
;
step
=
GET_MODE_NUNITS
(
mode
)
/
4
;
copies
=
1
;
copies
=
1
;
...
@@ -5022,8 +5045,16 @@ output_vec_const_move (rtx *operands)
...
@@ -5022,8 +5045,16 @@ output_vec_const_move (rtx *operands)
vec
=
operands
[
1
];
vec
=
operands
[
1
];
mode
=
GET_MODE
(
dest
);
mode
=
GET_MODE
(
dest
);
if
(
TARGET_VSX
&&
zero_constant
(
vec
,
mode
))
if
(
TARGET_VSX
)
return
"xxlxor %x0,%x0,%x0"
;
{
if
(
zero_constant
(
vec
,
mode
))
return
"xxlxor %x0,%x0,%x0"
;
if
(
mode
==
V2DImode
&&
INTVAL
(
CONST_VECTOR_ELT
(
vec
,
0
))
==
-
1
&&
INTVAL
(
CONST_VECTOR_ELT
(
vec
,
1
))
==
-
1
)
return
"vspltisw %0,-1"
;
}
if
(
TARGET_ALTIVEC
)
if
(
TARGET_ALTIVEC
)
{
{
...
...
gcc/testsuite/ChangeLog
View file @
93b826f0
2011-03-08 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/47755
* gcc.target/powerpc/pr47755-2.c: New file.
2011-03-08 Jakub Jelinek <jakub@redhat.com>
2011-03-08 Jakub Jelinek <jakub@redhat.com>
* go.test/go-test.exp: For goroutines.go test if GCCGO_RUN_ALL_TESTS
* go.test/go-test.exp: For goroutines.go test if GCCGO_RUN_ALL_TESTS
...
...
gcc/testsuite/gcc.target/powerpc/pr47755-2.c
0 → 100644
View file @
93b826f0
/* { dg-do run { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O3 -mcpu=power7" } */
/* PR 47755: Make sure compiler generates correct code for various
V2DI constants. */
#ifdef DEBUG
#include <stdio.h>
static
int
num_errors
;
#define FAIL_LL(A, B) \
(num_errors++, printf ("Fail (%i, %i)\n", (int)(A), (int)(B)))
#define FAIL_I(A, B, C, D) \
(num_errors++, \
printf ("Fail (%i, %i, %i, %i)\n", (int)(A), (int)(B), (int)(C), (int)(D)))
#else
extern
void
abort
(
void
)
__attribute__
((
__noreturn__
));
#define FAIL_LL(A, B) abort ()
#define FAIL_I(A, B, C, D) abort ()
#endif
static
test_ll
(
vector
long
long
,
long
long
,
long
long
)
__attribute__
((
__noinline__
));
static
test_ll
(
vector
long
long
v
,
long
long
a
,
long
long
b
)
{
union
{
vector
long
long
v
;
long
long
ll
[
2
];
}
u
;
u
.
v
=
v
;
if
(
u
.
ll
[
0
]
!=
a
&&
u
.
ll
[
1
]
!=
b
)
FAIL_LL
(
a
,
b
);
}
#define TEST_LL(A,B) test_ll ((vector long long){ (A), (B) }, (A), (B))
static
test_i
(
vector
int
,
int
,
int
,
int
,
int
)
__attribute__
((
__noinline__
));
static
test_i
(
vector
int
v
,
int
a
,
int
b
,
int
c
,
int
d
)
{
union
{
vector
int
v
;
int
i
[
4
];
}
u
;
u
.
v
=
v
;
if
(
u
.
i
[
0
]
!=
a
&&
u
.
i
[
1
]
!=
b
&&
u
.
i
[
2
]
!=
c
&&
u
.
i
[
3
]
!=
d
)
FAIL_I
(
a
,
b
,
c
,
d
);
}
#define TEST_I(A,B,C,D) \
test_i ((vector int){ (A), (B), (C), (D) }, (A), (B), (C), (D))
int
main
(
void
)
{
TEST_LL
(
-
2LL
,
-
2LL
);
TEST_LL
(
-
2LL
,
-
1LL
);
TEST_LL
(
-
2LL
,
0LL
);
TEST_LL
(
-
2LL
,
1LL
);
TEST_LL
(
-
2LL
,
2LL
);
TEST_LL
(
-
1LL
,
-
2LL
);
TEST_LL
(
-
1LL
,
-
1LL
);
TEST_LL
(
-
1LL
,
0LL
);
TEST_LL
(
-
1LL
,
1LL
);
TEST_LL
(
-
1LL
,
2LL
);
TEST_LL
(
0LL
,
-
2LL
);
TEST_LL
(
0LL
,
-
1LL
);
TEST_LL
(
0LL
,
0LL
);
TEST_LL
(
0LL
,
1LL
);
TEST_LL
(
0LL
,
2LL
);
TEST_LL
(
1LL
,
-
2LL
);
TEST_LL
(
1LL
,
-
1LL
);
TEST_LL
(
1LL
,
0LL
);
TEST_LL
(
1LL
,
1LL
);
TEST_LL
(
1LL
,
2LL
);
TEST_LL
(
2LL
,
-
2LL
);
TEST_LL
(
2LL
,
-
1LL
);
TEST_LL
(
2LL
,
0LL
);
TEST_LL
(
2LL
,
1LL
);
TEST_LL
(
2LL
,
2LL
);
/* We could use VSPLTI instructions for these tests. */
TEST_LL
(
0x0101010101010101LL
,
0x0101010101010101LL
);
TEST_LL
(
0x0001000100010001LL
,
0x0001000100010001LL
);
TEST_LL
(
0x0000000100000001LL
,
0x0000000100000001LL
);
TEST_LL
(
0x0404040404040404LL
,
0x0404040404040404LL
);
TEST_LL
(
0x0004000400040004LL
,
0x0004000400040004LL
);
TEST_LL
(
0x0000000400000004LL
,
0x0000000400000004LL
);
TEST_LL
(
0xf8f8f8f8f8f8f8f8LL
,
0xf8f8f8f8f8f8f8f8LL
);
TEST_LL
(
0xfff8fff8fff8fff8LL
,
0xfff8fff8fff8fff8LL
);
TEST_LL
(
0xfffffff8fffffff8LL
,
0xfffffff8fffffff8LL
);
/* We could use VSPLTI instructions for these tests. */
TEST_I
(
-
2
,
-
2
,
-
2
,
-
2
);
TEST_I
(
-
1
,
-
1
,
-
1
,
-
1
);
TEST_I
(
0
,
0
,
0
,
0
);
TEST_I
(
1
,
1
,
1
,
1
);
TEST_I
(
2
,
2
,
2
,
2
);
TEST_I
(
0x01010101
,
0x01010101
,
0x01010101
,
0x01010101
);
TEST_I
(
0x00010001
,
0x00010001
,
0x00010001
,
0x00010001
);
TEST_I
(
0x02020202
,
0x02020202
,
0x02020202
,
0x02020202
);
TEST_I
(
0x00020002
,
0x00020002
,
0x00020002
,
0x00020002
);
TEST_I
(
0xf8f8f8f8
,
0xf8f8f8f8
,
0xf8f8f8f8
,
0xf8f8f8f8
);
TEST_I
(
0xfff8fff8
,
0xfff8fff8
,
0xfff8fff8
,
0xfff8fff8
);
/* non-easy constants. */
TEST_I
(
-
2
,
-
1
,
0
,
1
);
TEST_I
(
1
,
0
,
-
1
,
-
2
);
TEST_I
(
-
1
,
-
1
,
0
,
0
);
TEST_I
(
0
,
0
,
-
1
,
-
1
);
#ifdef DEBUG
printf
(
"%d error%s
\n
"
,
num_errors
,
(
num_errors
==
1
)
?
""
:
"s"
);
#endif
return
0
;
};
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