Commit 0dfa6c5e by Ulrich Weigand Committed by Ulrich Weigand

s390-protos.h (s390_narrow_logical_operator): Add.

	* config/s390/s390-protos.h (s390_narrow_logical_operator): Add.
	* config/s390/s390.c (s390_narrow_logical_operator): New function.
	(s390_extra_constraint_str): Add 'A' constraints.
	(s390_const_ok_for_constraint_p): Add 'Nx' constraints.
	* config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'A' constraint.
	(CONSTRAINT_LEN): Likewise.
	* config/s390/s390.md ("*anddi3"): Add NI alternative and splitter.
	("*andsi3_zarch", "*andsi3_esa"): Likewise.
	("*andhi3_zarch", "*andhi3_esa"): Likewise.
	("*iordi3"): Add OI alternative and splitter.
	("*iorsi3_zarch", "*iorsi3_esa"): Likewise.
	("*iorhi3_zarch", "*iorhi3_esa"): Likewise.
	("*xordi3"): Add XI alternative and splitter.
	("*xorsi3", "*xorhi3"): Likewise.

From-SVN: r88705
parent 82e79986
2004-10-07 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_narrow_logical_operator): Add.
* config/s390/s390.c (s390_narrow_logical_operator): New function.
(s390_extra_constraint_str): Add 'A' constraints.
(s390_const_ok_for_constraint_p): Add 'Nx' constraints.
* config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'A' constraint.
(CONSTRAINT_LEN): Likewise.
* config/s390/s390.md ("*anddi3"): Add NI alternative and splitter.
("*andsi3_zarch", "*andsi3_esa"): Likewise.
("*andhi3_zarch", "*andhi3_esa"): Likewise.
("*iordi3"): Add OI alternative and splitter.
("*iorsi3_zarch", "*iorsi3_esa"): Likewise.
("*iorhi3_zarch", "*iorhi3_esa"): Likewise.
("*xordi3"): Add XI alternative and splitter.
("*xorsi3", "*xorhi3"): Likewise.
2004-10-07 Richard Sandiford <rsandifo@redhat.com> 2004-10-07 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_function_rodata_section): New function. * config/mips/mips.c (mips_function_rodata_section): New function.
......
...@@ -87,6 +87,7 @@ extern rtx s390_emit_call (rtx, rtx, rtx, rtx); ...@@ -87,6 +87,7 @@ extern rtx s390_emit_call (rtx, rtx, rtx, rtx);
extern void s390_expand_logical_operator (enum rtx_code, extern void s390_expand_logical_operator (enum rtx_code,
enum machine_mode, rtx *); enum machine_mode, rtx *);
extern bool s390_logical_operator_ok_p (rtx *); extern bool s390_logical_operator_ok_p (rtx *);
extern void s390_narrow_logical_operator (enum rtx_code, rtx *, rtx *);
extern bool s390_pool_operand (rtx); extern bool s390_pool_operand (rtx);
extern bool s390_output_addr_const_extra (FILE*, rtx); extern bool s390_output_addr_const_extra (FILE*, rtx);
......
...@@ -1166,6 +1166,27 @@ s390_logical_operator_ok_p (rtx *operands) ...@@ -1166,6 +1166,27 @@ s390_logical_operator_ok_p (rtx *operands)
return true; return true;
} }
/* Narrow logical operation CODE of memory operand MEMOP with immediate
operand IMMOP to switch from SS to SI type instructions. */
void
s390_narrow_logical_operator (enum rtx_code code, rtx *memop, rtx *immop)
{
int def = code == AND ? -1 : 0;
HOST_WIDE_INT mask;
int part;
gcc_assert (GET_CODE (*memop) == MEM);
gcc_assert (!MEM_VOLATILE_P (*memop));
mask = s390_extract_part (*immop, QImode, def);
part = s390_single_part (*immop, GET_MODE (*memop), QImode, def);
gcc_assert (part >= 0);
*memop = adjust_address (*memop, QImode, part);
*immop = gen_int_mode (mask, QImode);
}
/* Change optimizations to be performed, depending on the /* Change optimizations to be performed, depending on the
optimization level. optimization level.
...@@ -1564,6 +1585,21 @@ s390_extra_constraint_str (rtx op, int c, const char * str) ...@@ -1564,6 +1585,21 @@ s390_extra_constraint_str (rtx op, int c, const char * str)
if (c != str[0]) if (c != str[0])
abort (); abort ();
/* Check for offsettable variants of memory constraints. */
if (c == 'A')
{
/* Only accept non-volatile MEMs. */
if (!MEM_P (op) || MEM_VOLATILE_P (op))
return 0;
if ((reload_completed || reload_in_progress)
? !offsettable_memref_p (op)
: !offsettable_nonstrict_memref_p (op))
return 0;
c = str[1];
}
switch (c) switch (c)
{ {
case 'Q': case 'Q':
...@@ -1658,7 +1694,7 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value, ...@@ -1658,7 +1694,7 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
{ {
enum machine_mode mode, part_mode; enum machine_mode mode, part_mode;
int def; int def;
unsigned char part; int part, part_goal;
if (c != str[0]) if (c != str[0])
abort (); abort ();
...@@ -1682,7 +1718,10 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value, ...@@ -1682,7 +1718,10 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
return value == 2147483647; return value == 2147483647;
case 'N': case 'N':
part = str[1] - '0'; if (str[1] == 'x')
part_goal = -1;
else
part_goal = str[1] - '0';
switch (str[2]) switch (str[2])
{ {
...@@ -1709,7 +1748,10 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value, ...@@ -1709,7 +1748,10 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode)) if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode))
return 0; return 0;
if (s390_single_part (GEN_INT (value), mode, part_mode, def) != part) part = s390_single_part (GEN_INT (value), mode, part_mode, def);
if (part < 0)
return 0;
if (part_goal != -1 && part_goal != part)
return 0; return 0;
break; break;
......
...@@ -542,13 +542,14 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ...@@ -542,13 +542,14 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
#define EXTRA_CONSTRAINT_STR(OP, C, STR) \ #define EXTRA_CONSTRAINT_STR(OP, C, STR) \
s390_extra_constraint_str ((OP), (C), (STR)) s390_extra_constraint_str ((OP), (C), (STR))
#define EXTRA_MEMORY_CONSTRAINT(C, STR) \ #define EXTRA_MEMORY_CONSTRAINT(C, STR) \
((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T') ((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T' || (C) == 'A')
#define EXTRA_ADDRESS_CONSTRAINT(C, STR) \ #define EXTRA_ADDRESS_CONSTRAINT(C, STR) \
((C) == 'U' || (C) == 'W' || (C) == 'Y') ((C) == 'U' || (C) == 'W' || (C) == 'Y')
#define CONSTRAINT_LEN(C, STR) \ #define CONSTRAINT_LEN(C, STR) \
((C) == 'N' ? 5 : DEFAULT_CONSTRAINT_LEN ((C), (STR))) ((C) == 'N' ? 5 : \
(C) == 'A' ? 2 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
/* Stack layout and calling conventions. */ /* Stack layout and calling conventions. */
......
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