Commit ae5f0df1 by Oleg Endo

re PR target/58219 ([SH] mov.l insn length is wrong on SH2A)

gcc/
	PR target/58219
	* config/sh/predicates.md (long_displacement_mem_operand): New.
	* config/sh/sh.md (movsi_i): Allow for SH2A, disallow for any FPU.
	Add movi20, movi20s alternatives.  Adjust length attribute for
	alternatives.
	(movsi_ie): Allow for any FPU.  Adjust length attribute for
	alternatives.
	(movsi_i_lowpart): Add movi20, movi20s alternatives.  Adjust length
	attribute for alternatives.
	(*mov<mode>): Use long_displacement_mem_operand for length attribute.
	(*movdi_i, movdf_k, movdf_i4, movsf_i, movsf_ie, movsf_ie_ra): Adjust
	length attribute for alternatives.

gcc/testsuite/
	PR target/58219
	*gcc.target/sh/pr58219.c: New tests.

From-SVN: r235954
parent 078f7e37
2016-05-06 Oleg Endo <olegendo@gcc.gnu.org>
PR target/58219
* config/sh/predicates.md (long_displacement_mem_operand): New.
* config/sh/sh.md (movsi_i): Allow for SH2A, disallow for any FPU.
Add movi20, movi20s alternatives. Adjust length attribute for
alternatives.
(movsi_ie): Allow for any FPU. Adjust length attribute for
alternatives.
(movsi_i_lowpart): Add movi20, movi20s alternatives. Adjust length
attribute for alternatives.
(*mov<mode>): Use long_displacement_mem_operand for length attribute.
(*movdi_i, movdf_k, movdf_i4, movsf_i, movsf_ie, movsf_ie_ra): Adjust
length attribute for alternatives.
2016-05-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/70960
......
......@@ -230,6 +230,12 @@
(match_test "sh_disp_addr_displacement (op)
<= sh_max_mov_insn_displacement (GET_MODE (op), false)")))
;; Returns true if OP is a displacement address that does not fit into
;; a 16 bit (non-SH2A) memory load / store insn.
(define_predicate "long_displacement_mem_operand"
(and (match_operand 0 "displacement_mem_operand")
(not (match_operand 0 "short_displacement_mem_operand"))))
;; Returns true if OP is a post-increment addressing mode memory reference.
(define_predicate "post_inc_mem"
(and (match_code "mem")
......
2016-05-06 Oleg Endo <olegendo@gcc.gnu.org>
PR target/58219
*gcc.target/sh/pr58219.c: New tests.
2016-05-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/70960
......
/* Check that move instructions have the correct length on SH2A. */
/* { dg-do compile } */
/* { dg-options "-O1 -dp" } */
/* { dg-final { scan-assembler-times "length = 4" 10 { target { "sh2a" && any_fpu } } } } */
/* { dg-final { scan-assembler-times "length = 4" 8 { target { "sh2a" && no_fpu } } } } */
int
test_00 (int* x)
{
return x[0];
}
int
test_01 (int* x)
{
return x[1];
}
int
test_02 (int* x)
{
return x[100];
}
int
test_03 (int* x, unsigned int y)
{
return *(int*)((unsigned int)x + y);
}
float
test_04 (float* x)
{
return x[0];
}
float
test_05 (float* x)
{
return x[5];
}
float
test_06 (float* x)
{
return x[100];
}
int
test_07 (void)
{
return 1230;
}
int
test_08 (void)
{
return 0xFF0000;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment