]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AArch64] Factor out pfalse predicate creation
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 14:51:02 +0000 (14:51 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 14:51:02 +0000 (14:51 +0000)
Following on from the previous ptrue patch.

2019-06-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64-protos.h (aarch64_pfalse_reg): Declare.
* config/aarch64/aarch64.c (aarch64_pfalse_reg): New function.
* config/aarch64/aarch64-sve.md: Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272425 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/aarch64.c

index 41764984eecf620dd3eb852d9ca44187d9cadc98..ce470a8160caaf4d32382f36e71a742153342d2e 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-18  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/aarch64/aarch64-protos.h (aarch64_pfalse_reg): Declare.
+       * config/aarch64/aarch64.c (aarch64_pfalse_reg): New function.
+       * config/aarch64/aarch64-sve.md: Use it.
+
 2019-06-18  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64-protos.h (aarch64_ptrue_reg): Declare.
index 3a8be2212f9ede98abbe61cd3837ff1fa4c6bcc6..4b207961553b645c624efd3a712a76520ebd3fe2 100644 (file)
@@ -521,6 +521,7 @@ void aarch64_err_no_fpadvsimd (machine_mode);
 void aarch64_expand_epilogue (bool);
 void aarch64_expand_mov_immediate (rtx, rtx, rtx (*) (rtx, rtx) = 0);
 rtx aarch64_ptrue_reg (machine_mode);
+rtx aarch64_pfalse_reg (machine_mode);
 void aarch64_emit_sve_pred_move (rtx, rtx, rtx);
 void aarch64_expand_sve_mem_move (rtx, rtx, machine_mode);
 bool aarch64_maybe_expand_sve_subreg_move (rtx, rtx);
index eef8ed60c9f91b055c84964c1c437f59fc637655..9055ae5d508edd8146590d84926b779de7142c95 100644 (file)
       {
        /* The last element can be extracted with a LASTB and a false
           predicate.  */
-       rtx sel = force_reg (<VPRED>mode, CONST0_RTX (<VPRED>mode));
+       rtx sel = aarch64_pfalse_reg (<VPRED>mode);
        emit_insn (gen_extract_last_<mode> (operands[0], sel, operands[1]));
        DONE;
       }
index d5dca76a1430fac3fc325e0ee8d46f4ced50bfb5..9a30d156d85897e553cbac4813982e756d3da983 100644 (file)
@@ -2467,6 +2467,15 @@ aarch64_ptrue_reg (machine_mode mode)
   return force_reg (mode, CONSTM1_RTX (mode));
 }
 
+/* Return an all-false predicate register of mode MODE.  */
+
+rtx
+aarch64_pfalse_reg (machine_mode mode)
+{
+  gcc_assert (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL);
+  return force_reg (mode, CONST0_RTX (mode));
+}
+
 /* Return true if we can move VALUE into a register using a single
    CNT[BHWD] instruction.  */