Commit 048b1c95 by Jakub Jelinek

re PR c/5972 (produces wrong assembly code when -march=pentiumpro and optimization (e.g. -O2)is on)

	PR c/5972
	* config/i386/i386.md (movdicc_c_rex64, movsicc_noc, movhicc_noc,
	movsfcc_1, movdfcc_1): Add %O2.
	* config/i386/i386.c (print_operand): Handle %ON.
	Print . before float condition codes in Sun as cmov syntax.
	* config/i386/sol2.h (CMOV_SUN_AS_SYNTAX): Define for Sun as.
	* config.gcc (i[34567]86-*-solaris2*): Remove comment which is
	no longer true.

From-SVN: r51086
parent f4864588
2002-03-20 Jakub Jelinek <jakub@redhat.com>
PR c/5972
* config/i386/i386.md (movdicc_c_rex64, movsicc_noc, movhicc_noc,
movsfcc_1, movdfcc_1): Add %O2.
* config/i386/i386.c (print_operand): Handle %ON.
Print . before float condition codes in Sun as cmov syntax.
* config/i386/sol2.h (CMOV_SUN_AS_SYNTAX): Define for Sun as.
* config.gcc (i[34567]86-*-solaris2*): Remove comment which is
no longer true.
2002-03-20 Philip Blundell <pb@nexus.co.uk> 2002-03-20 Philip Blundell <pb@nexus.co.uk>
* config/arm/arm.c (arm_output_epilogue): Don't generate separate * config/arm/arm.c (arm_output_epilogue): Don't generate separate
...@@ -8,7 +19,7 @@ ...@@ -8,7 +19,7 @@
* config/xtensa/xtensa.md: Remove unused type attributes. * config/xtensa/xtensa.md: Remove unused type attributes.
(adddi_carry, subddi_carry): Change type attribute to "multi". (adddi_carry, subddi_carry): Change type attribute to "multi".
2002-03-19 Dale Johannesen <dalej@apple.com> 2002-03-19 Dale Johannesen <dalej@apple.com>
PR optimization/5999, middle-end/5731 PR optimization/5999, middle-end/5731
* expr.c (expand_expr) [RDIV_EXPR]: Only convert real divisions into * expr.c (expand_expr) [RDIV_EXPR]: Only convert real divisions into
......
...@@ -1333,7 +1333,6 @@ i[34567]86-*-solaris2*) ...@@ -1333,7 +1333,6 @@ i[34567]86-*-solaris2*)
xm_defines="POSIX SMALL_ARG_MAX" xm_defines="POSIX SMALL_ARG_MAX"
tm_file="${tm_file} i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sol2.h" tm_file="${tm_file} i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sol2.h"
if test x$gas = xyes; then if test x$gas = xyes; then
# Only needed if gas does not support -s
tm_file="i386/sol2gas.h ${tm_file}" tm_file="i386/sol2gas.h ${tm_file}"
fi fi
tmake_file="i386/t-sol2 t-svr4" tmake_file="i386/t-sol2 t-svr4"
......
...@@ -5640,6 +5640,8 @@ print_reg (x, code, file) ...@@ -5640,6 +5640,8 @@ print_reg (x, code, file)
C -- print opcode suffix for set/cmov insn. C -- print opcode suffix for set/cmov insn.
c -- like C, but print reversed condition c -- like C, but print reversed condition
F,f -- likewise, but for floating-point. F,f -- likewise, but for floating-point.
O -- if CMOV_SUN_AS_SYNTAX, expand to "w.", "l." or "q.", otherwise
nothing
R -- print the prefix for register names. R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand. z -- print the opcode suffix for the size of the current operand.
* -- print a star (in certain assembler syntax) * -- print a star (in certain assembler syntax)
...@@ -5837,10 +5839,31 @@ print_operand (file, x, code) ...@@ -5837,10 +5839,31 @@ print_operand (file, x, code)
break; break;
} }
return; return;
case 'O':
#ifdef CMOV_SUN_AS_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
{
switch (GET_MODE (x))
{
case HImode: putc ('w', file); break;
case SImode:
case SFmode: putc ('l', file); break;
case DImode:
case DFmode: putc ('q', file); break;
default: abort ();
}
putc ('.', file);
}
#endif
return;
case 'C': case 'C':
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 0, file); put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 0, file);
return; return;
case 'F': case 'F':
#ifdef CMOV_SUN_AS_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
#endif
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 1, file); put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 0, 1, file);
return; return;
...@@ -5856,6 +5879,10 @@ print_operand (file, x, code) ...@@ -5856,6 +5879,10 @@ print_operand (file, x, code)
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file); put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file);
return; return;
case 'f': case 'f':
#ifdef CMOV_SUN_AS_SYNTAX
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('.', file);
#endif
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 1, file); put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 1, file);
return; return;
case '+': case '+':
......
...@@ -15896,8 +15896,8 @@ ...@@ -15896,8 +15896,8 @@
"TARGET_64BIT && TARGET_CMOVE "TARGET_64BIT && TARGET_CMOVE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
"@ "@
cmov%C1\t{%2, %0|%0, %2} cmov%O2%C1\t{%2, %0|%0, %2}
cmov%c1\t{%3, %0|%0, %3}" cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "icmov") [(set_attr "type" "icmov")
(set_attr "mode" "DI")]) (set_attr "mode" "DI")])
...@@ -15938,8 +15938,8 @@ ...@@ -15938,8 +15938,8 @@
"TARGET_CMOVE "TARGET_CMOVE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
"@ "@
cmov%C1\t{%2, %0|%0, %2} cmov%O2%C1\t{%2, %0|%0, %2}
cmov%c1\t{%3, %0|%0, %3}" cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "icmov") [(set_attr "type" "icmov")
(set_attr "mode" "SI")]) (set_attr "mode" "SI")])
...@@ -15960,8 +15960,8 @@ ...@@ -15960,8 +15960,8 @@
"TARGET_CMOVE "TARGET_CMOVE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
"@ "@
cmov%C1\t{%2, %0|%0, %2} cmov%O2%C1\t{%2, %0|%0, %2}
cmov%c1\t{%3, %0|%0, %3}" cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "icmov") [(set_attr "type" "icmov")
(set_attr "mode" "HI")]) (set_attr "mode" "HI")])
...@@ -15984,8 +15984,8 @@ ...@@ -15984,8 +15984,8 @@
"@ "@
fcmov%F1\t{%2, %0|%0, %2} fcmov%F1\t{%2, %0|%0, %2}
fcmov%f1\t{%3, %0|%0, %3} fcmov%f1\t{%3, %0|%0, %3}
cmov%C1\t{%2, %0|%0, %2} cmov%O2%C1\t{%2, %0|%0, %2}
cmov%c1\t{%3, %0|%0, %3}" cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "fcmov,fcmov,icmov,icmov") [(set_attr "type" "fcmov,fcmov,icmov,icmov")
(set_attr "mode" "SF,SF,SI,SI")]) (set_attr "mode" "SF,SF,SI,SI")])
...@@ -16024,8 +16024,8 @@ ...@@ -16024,8 +16024,8 @@
"@ "@
fcmov%F1\t{%2, %0|%0, %2} fcmov%F1\t{%2, %0|%0, %2}
fcmov%f1\t{%3, %0|%0, %3} fcmov%f1\t{%3, %0|%0, %3}
cmov%C1\t{%2, %0|%0, %2} cmov%O2%C1\t{%2, %0|%0, %2}
cmov%c1\t{%3, %0|%0, %3}" cmov%O2%c1\t{%3, %0|%0, %3}"
[(set_attr "type" "fcmov,fcmov,icmov,icmov") [(set_attr "type" "fcmov,fcmov,icmov,icmov")
(set_attr "mode" "DF")]) (set_attr "mode" "DF")])
......
...@@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA. */
#define ASM_SPEC \ #define ASM_SPEC \
"%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s" "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s"
#define CMOV_SUN_AS_SYNTAX 1
#else /* GAS_REJECTS_MINUS_S */ #else /* GAS_REJECTS_MINUS_S */
/* Same as above, except for -s, unsupported by GNU as. */ /* Same as above, except for -s, unsupported by GNU as. */
......
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