Commit 35cb3e53 by Kyrylo Tkachov Committed by Kyrylo Tkachov

[ARM][1/7] Convert FP mnemonics to UAL | mov patterns.

	* config/arm/arm.c (output_move_vfp): Use UAL syntax for load/store
	multiple.
	(arm_print_operand): Don't convert real values to decimal
	representation in default case.
	(fp_immediate_constant): Delete.
	* config/arm/arm-protos.h (fp_immediate_constant): Likewise.
	* config/arm/vfp.md (*arm_movsi_vfp): Convert to VFP moves to UAL
	syntax.
	(*thumb2_movsi_vfp): Likewise.
	(*movdi_vfp): Likewise.
	(*movdi_vfp_cortexa8): Likewise.
	(*movhf_vfp_neon): Likewise.
	(*movhf_vfp): Likewise.
	(*movsf_vfp): Likewise.
	(*thumb2_movsf_vfp): Likewise.
	(*movdf_vfp): Likewise.
	(*thumb2_movdf_vfp): Likewise.
	(*movsfcc_vfp): Likewise.
	(*thumb2_movsfcc_vfp): Likewise.
	(*movdfcc_vfp): Likewise.
	(*thumb2_movdfcc_vfp): Likewise.

	* gcc.target/arm/pr51835.c: Update expected assembly.
	* gcc.target/arm/vfp-1.c: Likewise.
	* gcc.target/arm/vfp-ldmdbd.c: Likewise.
	* gcc.target/arm/vfp-ldmdbs.c: Likewise.
	* gcc.target/arm/vfp-ldmiad.c: Likewise.
	* gcc.target/arm/vfp-ldmias.c: Likewise.
	* gcc.target/arm/vfp-stmdbd.c: Likewise.
	* gcc.target/arm/vfp-stmdbs.c: Likewise.
	* gcc.target/arm/vfp-stmiad.c: Likewise.
	* gcc.target/arm/vfp-stmias.c: Likewise.

From-SVN: r215050
parent 995ba386
2014-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.c (output_move_vfp): Use UAL syntax for load/store
multiple.
(arm_print_operand): Don't convert real values to decimal
representation in default case.
(fp_immediate_constant): Delete.
* config/arm/arm-protos.h (fp_immediate_constant): Likewise.
* config/arm/vfp.md (*arm_movsi_vfp): Convert to VFP moves to UAL
syntax.
(*thumb2_movsi_vfp): Likewise.
(*movdi_vfp): Likewise.
(*movdi_vfp_cortexa8): Likewise.
(*movhf_vfp_neon): Likewise.
(*movhf_vfp): Likewise.
(*movsf_vfp): Likewise.
(*thumb2_movsf_vfp): Likewise.
(*movdf_vfp): Likewise.
(*thumb2_movdf_vfp): Likewise.
(*movsfcc_vfp): Likewise.
(*thumb2_movsfcc_vfp): Likewise.
(*movdfcc_vfp): Likewise.
(*thumb2_movdfcc_vfp): Likewise.
2014-09-09 James Greenhalgh <james.greenhalgh@arm.com> 2014-09-09 James Greenhalgh <james.greenhalgh@arm.com>
* doc/invoke.texi (-march): Use GNU/Linux rather than Linux. * doc/invoke.texi (-march): Use GNU/Linux rather than Linux.
...@@ -126,7 +126,6 @@ extern int arm_max_const_double_inline_cost (void); ...@@ -126,7 +126,6 @@ extern int arm_max_const_double_inline_cost (void);
extern int arm_const_double_inline_cost (rtx); extern int arm_const_double_inline_cost (rtx);
extern bool arm_const_double_by_parts (rtx); extern bool arm_const_double_by_parts (rtx);
extern bool arm_const_double_by_immediates (rtx); extern bool arm_const_double_by_immediates (rtx);
extern const char *fp_immediate_constant (rtx);
extern void arm_emit_call_insn (rtx, rtx, bool); extern void arm_emit_call_insn (rtx, rtx, bool);
extern const char *output_call (rtx *); extern const char *output_call (rtx *);
extern const char *output_call_mem (rtx *); extern const char *output_call_mem (rtx *);
......
...@@ -17539,24 +17539,7 @@ arm_reorg (void) ...@@ -17539,24 +17539,7 @@ arm_reorg (void)
/* Routines to output assembly language. */ /* Routines to output assembly language. */
/* If the rtx is the correct value then return the string of the number. /* Return string representation of passed in real value. */
In this way we can ensure that valid double constants are generated even
when cross compiling. */
const char *
fp_immediate_constant (rtx x)
{
REAL_VALUE_TYPE r;
if (!fp_consts_inited)
init_fp_table ();
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
gcc_assert (REAL_VALUES_EQUAL (r, value_fp0));
return "0";
}
/* As for fp_immediate_constant, but value is passed directly, not in rtx. */
static const char * static const char *
fp_const_from_val (REAL_VALUE_TYPE *r) fp_const_from_val (REAL_VALUE_TYPE *r)
{ {
...@@ -18472,19 +18455,19 @@ output_move_vfp (rtx *operands) ...@@ -18472,19 +18455,19 @@ output_move_vfp (rtx *operands)
switch (GET_CODE (addr)) switch (GET_CODE (addr))
{ {
case PRE_DEC: case PRE_DEC:
templ = "f%smdb%c%%?\t%%0!, {%%%s1}%s"; templ = "v%smdb%%?.%s\t%%0!, {%%%s1}%s";
ops[0] = XEXP (addr, 0); ops[0] = XEXP (addr, 0);
ops[1] = reg; ops[1] = reg;
break; break;
case POST_INC: case POST_INC:
templ = "f%smia%c%%?\t%%0!, {%%%s1}%s"; templ = "v%smia%%?.%s\t%%0!, {%%%s1}%s";
ops[0] = XEXP (addr, 0); ops[0] = XEXP (addr, 0);
ops[1] = reg; ops[1] = reg;
break; break;
default: default:
templ = "f%s%c%%?\t%%%s0, %%1%s"; templ = "v%sr%%?.%s\t%%%s0, %%1%s";
ops[0] = reg; ops[0] = reg;
ops[1] = mem; ops[1] = mem;
break; break;
...@@ -18492,7 +18475,7 @@ output_move_vfp (rtx *operands) ...@@ -18492,7 +18475,7 @@ output_move_vfp (rtx *operands)
sprintf (buff, templ, sprintf (buff, templ,
load ? "ld" : "st", load ? "ld" : "st",
dp ? 'd' : 's', dp ? "64" : "32",
dp ? "P" : "", dp ? "P" : "",
integer_p ? "\t%@ int" : ""); integer_p ? "\t%@ int" : "");
output_asm_insn (buff, ops); output_asm_insn (buff, ops);
...@@ -22144,15 +22127,12 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -22144,15 +22127,12 @@ arm_print_operand (FILE *stream, rtx x, int code)
break; break;
case CONST_DOUBLE: case CONST_DOUBLE:
if (TARGET_NEON) {
{ char fpstr[20];
char fpstr[20]; real_to_decimal (fpstr, CONST_DOUBLE_REAL_VALUE (x),
real_to_decimal (fpstr, CONST_DOUBLE_REAL_VALUE (x), sizeof (fpstr), 0, 1);
sizeof (fpstr), 0, 1); fprintf (stream, "#%s", fpstr);
fprintf (stream, "#%s", fpstr); }
}
else
fprintf (stream, "#%s", fp_immediate_constant (x));
break; break;
default: default:
......
2014-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/arm/pr51835.c: Update expected assembly.
* gcc.target/arm/vfp-1.c: Likewise.
* gcc.target/arm/vfp-ldmdbd.c: Likewise.
* gcc.target/arm/vfp-ldmdbs.c: Likewise.
* gcc.target/arm/vfp-ldmiad.c: Likewise.
* gcc.target/arm/vfp-ldmias.c: Likewise.
* gcc.target/arm/vfp-stmdbd.c: Likewise.
* gcc.target/arm/vfp-stmdbs.c: Likewise.
* gcc.target/arm/vfp-stmiad.c: Likewise.
* gcc.target/arm/vfp-stmias.c: Likewise.
2014-09-09 Tony Wang <tony.wang@arm.com> 2014-09-09 Tony Wang <tony.wang@arm.com>
* gcc.target/arm/xordi3-opt.c: Disable this * gcc.target/arm/xordi3-opt.c: Disable this
......
...@@ -13,5 +13,5 @@ unsigned int func2 (double d) ...@@ -13,5 +13,5 @@ unsigned int func2 (double d)
return (unsigned int)d; return (unsigned int)d;
} }
/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 { target { arm_little_endian } } } } */ /* { dg-final { scan-assembler-times "vmov\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 { target { arm_little_endian } } } } */
/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r1,\[\\t \]*r0,\[\\t \]*d0" 2 { target { ! arm_little_endian } } } } */ /* { dg-final { scan-assembler-times "vmov\[\\t \]+r1,\[\\t \]*r0,\[\\t \]*d0" 2 { target { ! arm_little_endian } } } } */
...@@ -126,14 +126,14 @@ void test_convert () { ...@@ -126,14 +126,14 @@ void test_convert () {
} }
void test_ldst (float f[], double d[]) { void test_ldst (float f[], double d[]) {
/* { dg-final { scan-assembler "flds.+ \\\[r0, #1020\\\]" } } */ /* { dg-final { scan-assembler "vldr.32.+ \\\[r0, #1020\\\]" } } */
/* { dg-final { scan-assembler "flds.+ \\\[r\[0-9\], #-1020\\\]" { target { arm32 && { ! arm_thumb2_ok } } } } } */ /* { dg-final { scan-assembler "vldr.32.+ \\\[r\[0-9\], #-1020\\\]" { target { arm32 && { ! arm_thumb2_ok } } } } } */
/* { dg-final { scan-assembler "add.+ r0, #1024" } } */ /* { dg-final { scan-assembler "add.+ r0, #1024" } } */
/* { dg-final { scan-assembler "fsts.+ \\\[r\[0-9\]\\\]\n" } } */ /* { dg-final { scan-assembler "vstr.32.+ \\\[r\[0-9\]\\\]\n" } } */
f[256] = f[255] + f[-255]; f[256] = f[255] + f[-255];
/* { dg-final { scan-assembler "fldd.+ \\\[r1, #1016\\\]" } } */ /* { dg-final { scan-assembler "vldr.64.+ \\\[r1, #1016\\\]" } } */
/* { dg-final { scan-assembler "fldd.+ \\\[r\[1-9\], #-1016\\\]" { target { arm32 && { ! arm_thumb2_ok } } } } } */ /* { dg-final { scan-assembler "vldr.64.+ \\\[r\[1-9\], #-1016\\\]" { target { arm32 && { ! arm_thumb2_ok } } } } } */
/* { dg-final { scan-assembler "fstd.+ \\\[r1, #256\\\]" } } */ /* { dg-final { scan-assembler "vstr.64.+ \\\[r1, #256\\\]" } } */
d[32] = d[127] + d[-127]; d[32] = d[127] + d[-127];
} }
...@@ -13,4 +13,4 @@ foo (double *p, double a, int n) ...@@ -13,4 +13,4 @@ foo (double *p, double a, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fldmdbd" } } */ /* { dg-final { scan-assembler "vldmdb.64" } } */
...@@ -13,4 +13,4 @@ foo (float *p, float a, int n) ...@@ -13,4 +13,4 @@ foo (float *p, float a, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fldmdbs" } } */ /* { dg-final { scan-assembler "vldmdb.32" } } */
...@@ -13,4 +13,4 @@ foo (double *p, double a, int n) ...@@ -13,4 +13,4 @@ foo (double *p, double a, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fldmiad" } } */ /* { dg-final { scan-assembler "vldmia.64" } } */
...@@ -13,4 +13,4 @@ foo (float *p, float a, int n) ...@@ -13,4 +13,4 @@ foo (float *p, float a, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fldmias" } } */ /* { dg-final { scan-assembler "vldmia.32" } } */
...@@ -12,4 +12,4 @@ foo (double *p, double a, double b, int n) ...@@ -12,4 +12,4 @@ foo (double *p, double a, double b, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fstmdbd" } } */ /* { dg-final { scan-assembler "vstmdb.64" } } */
...@@ -12,4 +12,4 @@ foo (float *p, float a, float b, int n) ...@@ -12,4 +12,4 @@ foo (float *p, float a, float b, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fstmdbs" } } */ /* { dg-final { scan-assembler "vstmdb.32" } } */
...@@ -12,4 +12,4 @@ foo (double *p, double a, double b, int n) ...@@ -12,4 +12,4 @@ foo (double *p, double a, double b, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fstmiad" } } */ /* { dg-final { scan-assembler "vstmia.64" } } */
...@@ -12,4 +12,4 @@ foo (float *p, float a, float b, int n) ...@@ -12,4 +12,4 @@ foo (float *p, float a, float b, int n)
while (n--); while (n--);
} }
/* { dg-final { scan-assembler "fstmias" } } */ /* { dg-final { scan-assembler "vstmia.32" } } */
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