+2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
+
+ * doc/md.texi: Document the x and y constraints for AArch64.
+ * config/aarch64/aarch64.h (FP_LO8_REGNUM_P): New macro.
+ (FP_LO8_REGS): New reg_class.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add an entry for FP_LO8_REGS.
+ * config/aarch64/aarch64.c (aarch64_hard_regno_nregs)
+ (aarch64_regno_regclass, aarch64_class_max_nregs): Handle FP_LO8_REGS.
+ * config/aarch64/predicates.md (aarch64_simd_register): Use
+ FP_REGNUM_P instead of checking the classes manually.
+ * config/aarch64/constraints.md (y): New constraint.
+
2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/iterators.md (perm_insn): Include the "1"/"2" suffix.
{
case FP_REGS:
case FP_LO_REGS:
+ case FP_LO8_REGS:
if (aarch64_sve_data_mode_p (mode))
return exact_div (GET_MODE_SIZE (mode),
BYTES_PER_SVE_VECTOR).to_constant ();
return POINTER_REGS;
if (FP_REGNUM_P (regno))
- return FP_LO_REGNUM_P (regno) ? FP_LO_REGS : FP_REGS;
+ return (FP_LO8_REGNUM_P (regno) ? FP_LO8_REGS
+ : FP_LO_REGNUM_P (regno) ? FP_LO_REGS : FP_REGS);
if (PR_REGNUM_P (regno))
return PR_LO_REGNUM_P (regno) ? PR_LO_REGS : PR_HI_REGS;
case POINTER_AND_FP_REGS:
case FP_REGS:
case FP_LO_REGS:
+ case FP_LO8_REGS:
if (aarch64_sve_data_mode_p (mode)
&& constant_multiple_p (GET_MODE_SIZE (mode),
BYTES_PER_SVE_VECTOR, &nregs))
#define FP_LO_REGNUM_P(REGNO) \
(((unsigned) (REGNO - V0_REGNUM)) <= (V15_REGNUM - V0_REGNUM))
+#define FP_LO8_REGNUM_P(REGNO) \
+ (((unsigned) (REGNO - V0_REGNUM)) <= (V7_REGNUM - V0_REGNUM))
+
#define PR_REGNUM_P(REGNO)\
(((unsigned) (REGNO - P0_REGNUM)) <= (P15_REGNUM - P0_REGNUM))
GENERAL_REGS,
STACK_REG,
POINTER_REGS,
+ FP_LO8_REGS,
FP_LO_REGS,
FP_REGS,
POINTER_AND_FP_REGS,
"GENERAL_REGS", \
"STACK_REG", \
"POINTER_REGS", \
+ "FP_LO8_REGS", \
"FP_LO_REGS", \
"FP_REGS", \
"POINTER_AND_FP_REGS", \
{ 0x7fffffff, 0x00000000, 0x00000003 }, /* GENERAL_REGS */ \
{ 0x80000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
{ 0xffffffff, 0x00000000, 0x00000003 }, /* POINTER_REGS */ \
+ { 0x00000000, 0x000000ff, 0x00000000 }, /* FP_LO8_REGS */ \
{ 0x00000000, 0x0000ffff, 0x00000000 }, /* FP_LO_REGS */ \
{ 0x00000000, 0xffffffff, 0x00000000 }, /* FP_REGS */ \
{ 0xffffffff, 0xffffffff, 0x00000003 }, /* POINTER_AND_FP_REGS */\
(define_register_constraint "x" "FP_LO_REGS"
"Floating point and SIMD vector registers V0 - V15.")
+(define_register_constraint "y" "FP_LO8_REGS"
+ "Floating point and SIMD vector registers V0 - V7.")
+
(define_constraint "I"
"A constant that can be used with an ADD operation."
(and (match_code "const_int")
(define_predicate "aarch64_simd_register"
(and (match_code "reg")
- (ior (match_test "REGNO_REG_CLASS (REGNO (op)) == FP_LO_REGS")
- (match_test "REGNO_REG_CLASS (REGNO (op)) == FP_REGS"))))
+ (match_test "FP_REGNUM_P (REGNO (op))")))
(define_predicate "aarch64_reg_or_zero"
(and (match_code "reg,subreg,const_int,const_double")
@item w
Floating point register, Advanced SIMD vector register or SVE vector register
+@item x
+Like @code{w}, but restricted to registers 0 to 15 inclusive.
+
+@item y
+Like @code{w}, but restricted to registers 0 to 7 inclusive.
+
@item Upl
One of the low eight SVE predicate registers (@code{P0} to @code{P7})
+2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.target/aarch64/asm-x-constraint-1.c: New test.
+ * gcc.target/aarch64/asm-y-constraint-1.c: Likewise.
+
2019-08-13 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/91414
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void
+f (void)
+{
+ register float s0 asm ("s0");
+ register float s7 asm ("s7");
+ register float s8 asm ("s8");
+ register float s15 asm ("s15");
+ register float s16 asm ("s16");
+ register float s31 asm ("s31");
+ asm volatile ("// s0 out: %s0" : "=w" (s0));
+ asm volatile ("// s0 in: %s0" :: "x" (s0));
+ asm volatile ("// s7 out: %s0" : "=w" (s7));
+ asm volatile ("// s7 in: %s0" :: "x" (s7));
+ asm volatile ("// s8 out: %s0" : "=w" (s8));
+ asm volatile ("// s8 in: %s0" :: "x" (s8));
+ asm volatile ("// s15 out: %s0" : "=w" (s15));
+ asm volatile ("// s15 in: %s0" :: "x" (s15));
+ asm volatile ("// s16 out: %s0" : "=w" (s16));
+ asm volatile ("// s16 in: %s0" :: "x" (s16));
+ asm volatile ("// s31 out: %s0" : "=w" (s31));
+ asm volatile ("// s31 in: %s0" :: "x" (s31));
+}
+
+/* { dg-final { scan-assembler {\t// s0 out: s0\n.*[/]/ s0 in: s0\n} } } */
+/* { dg-final { scan-assembler {\t// s7 out: s7\n.*[/]/ s7 in: s7\n} } } */
+/* { dg-final { scan-assembler {\t// s8 out: s8\n.*[/]/ s8 in: s8\n} } } */
+/* { dg-final { scan-assembler {\t// s15 out: s15\n.*[/]/ s15 in: s15\n} } } */
+/* { dg-final { scan-assembler {\t// s16 out: s16\n.*\tfmov\t(s[0-7]), s16\n.*[/]/ s16 in: \1\n} } } */
+/* { dg-final { scan-assembler {\t// s31 out: s31\n.*\tfmov\t(s[0-7]), s31\n.*[/]/ s31 in: \1\n} } } */
+/* { dg-final { scan-assembler-not {\t// s16 in: s16\n} } } */
+/* { dg-final { scan-assembler-not {\t// s31 in: s31\n} } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void
+f (void)
+{
+ register float s0 asm ("s0");
+ register float s7 asm ("s7");
+ register float s8 asm ("s8");
+ register float s15 asm ("s15");
+ register float s16 asm ("s16");
+ register float s31 asm ("s31");
+ asm volatile ("// s0 out: %s0" : "=w" (s0));
+ asm volatile ("// s0 in: %s0" :: "y" (s0));
+ asm volatile ("// s7 out: %s0" : "=w" (s7));
+ asm volatile ("// s7 in: %s0" :: "y" (s7));
+ asm volatile ("// s8 out: %s0" : "=w" (s8));
+ asm volatile ("// s8 in: %s0" :: "y" (s8));
+ asm volatile ("// s15 out: %s0" : "=w" (s15));
+ asm volatile ("// s15 in: %s0" :: "y" (s15));
+ asm volatile ("// s16 out: %s0" : "=w" (s16));
+ asm volatile ("// s16 in: %s0" :: "y" (s16));
+ asm volatile ("// s31 out: %s0" : "=w" (s31));
+ asm volatile ("// s31 in: %s0" :: "y" (s31));
+}
+
+/* { dg-final { scan-assembler {\t// s0 out: s0\n.*[/]/ s0 in: s0\n} } } */
+/* { dg-final { scan-assembler {\t// s7 out: s7\n.*[/]/ s7 in: s7\n} } } */
+/* { dg-final { scan-assembler {\t// s8 out: s8\n.*\tfmov\t(s[0-7]), s8\n.*[/]/ s8 in: \1\n} } } */
+/* { dg-final { scan-assembler {\t// s15 out: s15\n.*\tfmov\t(s[0-7]), s15\n.*[/]/ s15 in: \1\n} } } */
+/* { dg-final { scan-assembler {\t// s16 out: s16\n.*\tfmov\t(s[0-7]), s16\n.*[/]/ s16 in: \1\n} } } */
+/* { dg-final { scan-assembler {\t// s31 out: s31\n.*\tfmov\t(s[0-7]), s31\n.*[/]/ s31 in: \1\n} } } */
+/* { dg-final { scan-assembler-not {\t// s8 in: s8\n} } } */
+/* { dg-final { scan-assembler-not {\t// s15 in: s15\n} } } */
+/* { dg-final { scan-assembler-not {\t// s16 in: s16\n} } } */
+/* { dg-final { scan-assembler-not {\t// s31 in: s31\n} } } */