diff options
author | Andreas Krebbel <krebbel@linux.ibm.com> | 2019-03-11 13:30:35 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2019-03-11 13:30:35 +0000 |
commit | ac5aeaae413341adc57926e8ab43fd1e3ec9f7c2 (patch) | |
tree | 5b6a114eb45b1da41ba0090001479c5206b6e9b3 /gcc/config | |
parent | 8b9482b2d77da5b8db979845b49b3b91bcf898e9 (diff) | |
download | gcc-ac5aeaae413341adc57926e8ab43fd1e3ec9f7c2.zip gcc-ac5aeaae413341adc57926e8ab43fd1e3ec9f7c2.tar.gz gcc-ac5aeaae413341adc57926e8ab43fd1e3ec9f7c2.tar.bz2 |
S/390: Fix immediate vector operands for some builtins.
This fixes a problem with vec_add/sub_u128 builtins. The
s390_expand_builtin backend function is supposed to convert the
operand to TImode *AND* load it into a vector register. The current
implementation did only the conversion and gave up then.
gcc/ChangeLog:
2019-03-11 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390.c (s390_expand_builtin): Do the copy_to_reg not
only on the else branch.
gcc/testsuite/ChangeLog:
2019-03-11 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/zvector/vec-addc-u128.c: New test.
From-SVN: r269583
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/s390/s390.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index fce463f..b80d5e8 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -928,6 +928,8 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, continue; } + /* A memory operand is rejected by the memory_operand predicate. + Try making the address legal by copying it into a register. */ if (MEM_P (op[arity]) && insn_op->predicate == memory_operand && (GET_MODE (XEXP (op[arity], 0)) == Pmode @@ -951,10 +953,14 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, { op[arity] = tmp_rtx; } - else if (GET_MODE (op[arity]) == insn_op->mode - || GET_MODE (op[arity]) == VOIDmode - || (insn_op->predicate == address_operand - && GET_MODE (op[arity]) == Pmode)) + + /* The predicate rejects the operand although the mode is fine. + Copy the operand to register. */ + if (!insn_op->predicate (op[arity], insn_op->mode) + && (GET_MODE (op[arity]) == insn_op->mode + || GET_MODE (op[arity]) == VOIDmode + || (insn_op->predicate == address_operand + && GET_MODE (op[arity]) == Pmode))) { /* An address_operand usually has VOIDmode in the expander so we cannot use this. */ |