Commit f49e46d8 by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

re PR target/35492 (ICE building kernel sk_stream_wait_connect output_operand:…

re PR target/35492 (ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier)

	PR target/35492.
	* config/cris/cris.h (CRIS_CONST_OK_FOR_LETTER_P): Renamed from
	CONST_OK_FOR_LETTER_P.  All port-local users changed.
	(CONST_OK_FOR_CONSTRAINT_P): Define; implement Kc as old K,
	implement Kp matching power-of-two.
	(CONSTRAINT_LEN): Define to match.
	* config/cris/cris.md: Replace all use of constraint K with Kc.
	("*btst*): Use Kp for operand 0 of last alternative.

From-SVN: r137765
parent 2961c7a9
2008-07-14 Hans-Peter Nilsson <hp@axis.com>
PR target/35492.
* config/cris/cris.h (CRIS_CONST_OK_FOR_LETTER_P): Renamed from
CONST_OK_FOR_LETTER_P. All port-local users changed.
(CONST_OK_FOR_CONSTRAINT_P): Define; implement Kc as old K,
implement Kp matching power-of-two.
(CONSTRAINT_LEN): Define to match.
* config/cris/cris.md: Replace all use of constraint K with Kc.
("*btst*): Use Kp for operand 0 of last alternative.
2008-07-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2008-07-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR testsuite/36440 PR testsuite/36440
......
...@@ -684,7 +684,7 @@ cris_print_operand (FILE *file, rtx x, int code) ...@@ -684,7 +684,7 @@ cris_print_operand (FILE *file, rtx x, int code)
/* Print the unsigned supplied integer as if it were signed /* Print the unsigned supplied integer as if it were signed
and < 0, i.e print 255 or 65535 as -1, 254, 65534 as -2, etc. */ and < 0, i.e print 255 or 65535 as -1, 254, 65534 as -2, etc. */
if (!CONST_INT_P (x) if (!CONST_INT_P (x)
|| ! CONST_OK_FOR_LETTER_P (INTVAL (x), 'O')) || !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (x), 'O'))
LOSE_AND_RETURN ("invalid operand for 'b' modifier", x); LOSE_AND_RETURN ("invalid operand for 'b' modifier", x);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, fprintf (file, HOST_WIDE_INT_PRINT_DEC,
INTVAL (x)| (INTVAL (x) <= 255 ? ~255 : ~65535)); INTVAL (x)| (INTVAL (x) <= 255 ? ~255 : ~65535));
...@@ -1503,8 +1503,8 @@ cris_normal_notice_update_cc (rtx exp, rtx insn) ...@@ -1503,8 +1503,8 @@ cris_normal_notice_update_cc (rtx exp, rtx insn)
> CRIS_LAST_GENERAL_REGISTER)) > CRIS_LAST_GENERAL_REGISTER))
|| (TARGET_V32 || (TARGET_V32
&& GET_CODE (SET_SRC (exp)) == CONST_INT && GET_CODE (SET_SRC (exp)) == CONST_INT
&& CONST_OK_FOR_LETTER_P (INTVAL (SET_SRC (exp)), && CRIS_CONST_OK_FOR_LETTER_P (INTVAL (SET_SRC (exp)),
'I'))) 'I')))
{ {
/* There's no CC0 change for this case. Just check /* There's no CC0 change for this case. Just check
for overlap. */ for overlap. */
...@@ -1831,7 +1831,7 @@ cris_rtx_costs (rtx x, int code, int outer_code, int *total) ...@@ -1831,7 +1831,7 @@ cris_rtx_costs (rtx x, int code, int outer_code, int *total)
if (CONST_INT_P (XEXP (x, 1)) if (CONST_INT_P (XEXP (x, 1))
/* Two constants may actually happen before optimization. */ /* Two constants may actually happen before optimization. */
&& !CONST_INT_P (XEXP (x, 0)) && !CONST_INT_P (XEXP (x, 0))
&& !CONST_OK_FOR_LETTER_P (INTVAL (XEXP (x, 1)), 'I')) && !CRIS_CONST_OK_FOR_LETTER_P (INTVAL (XEXP (x, 1)), 'I'))
{ {
*total = (rtx_cost (XEXP (x, 0), outer_code) + 2 *total = (rtx_cost (XEXP (x, 0), outer_code) + 2
+ 2 * GET_MODE_NUNITS (GET_MODE (XEXP (x, 0)))); + 2 * GET_MODE_NUNITS (GET_MODE (XEXP (x, 0))));
...@@ -1905,7 +1905,8 @@ cris_address_cost (rtx x) ...@@ -1905,7 +1905,8 @@ cris_address_cost (rtx x)
/* A BDAP -32768 .. 32767 is like BDAP quick, but with 2 extra /* A BDAP -32768 .. 32767 is like BDAP quick, but with 2 extra
bytes. */ bytes. */
if (CONST_INT_P (tem2) && CONST_OK_FOR_LETTER_P (INTVAL (tem2), 'L')) if (CONST_INT_P (tem2)
&& CRIS_CONST_OK_FOR_LETTER_P (INTVAL (tem2), 'L'))
return (2 + 2) / 2; return (2 + 2) / 2;
/* A BDAP with some other constant is 2 bytes extra. */ /* A BDAP with some other constant is 2 bytes extra. */
......
...@@ -668,7 +668,7 @@ enum reg_class ...@@ -668,7 +668,7 @@ enum reg_class
/* We are now out of letters; we could use ten more. This forces us to /* We are now out of letters; we could use ten more. This forces us to
use C-code in the 'md' file. FIXME: Use some EXTRA_CONSTRAINTS. */ use C-code in the 'md' file. FIXME: Use some EXTRA_CONSTRAINTS. */
#define CONST_OK_FOR_LETTER_P(VALUE, C) \ #define CRIS_CONST_OK_FOR_LETTER_P(VALUE, C) \
( \ ( \
/* MOVEQ, CMPQ, ANDQ, ORQ. */ \ /* MOVEQ, CMPQ, ANDQ, ORQ. */ \
(C) == 'I' ? (VALUE) >= -32 && (VALUE) <= 31 : \ (C) == 'I' ? (VALUE) >= -32 && (VALUE) <= 31 : \
...@@ -691,6 +691,16 @@ enum reg_class ...@@ -691,6 +691,16 @@ enum reg_class
(C) == 'P' ? (VALUE) >= -32768 && (VALUE) <= 65535 : \ (C) == 'P' ? (VALUE) >= -32768 && (VALUE) <= 65535 : \
0) 0)
#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, S) \
( \
((C) != 'K' || (S)[1] == 'c') \
? CRIS_CONST_OK_FOR_LETTER_P (VALUE, C) : \
((C) == 'K' && (S)[1] == 'p') \
? exact_log2 (VALUE) >= 0 : \
0)
#define CONSTRAINT_LEN(C, S) ((C) == 'K' ? 2 : DEFAULT_CONSTRAINT_LEN (C, S))
/* It is really simple to make up a 0.0; it is the same as int-0 in /* It is really simple to make up a 0.0; it is the same as int-0 in
IEEE754. */ IEEE754. */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
......
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