re PR inline-asm/39590 (inline asm %z on amd64 says "ll" instead of "q")

PR target/39590
	* configure.ac (HAVE_AS_IX86_FILDQ): On x86 targets check whether
	the configured assembler supports fildq and fistpq mnemonics.
	(HAVE_AS_IX86_FILDS): Rename from HAVE_GAS_FILDS_FISTS.
	* configure: Regenerated.
	* config.in: Ditto.

	* config/i386/i386.c (print_operand): Handle 'Z'.
	['z']: Remove handling of special fild/fist suffixes.
	(output_fix_trunc): Use '%Z' to output suffix of fist{,p,tp} insn.
	* config/i386/i386.md (*floathi<mode>2_i387): Use '%Z' to output
	suffix of fild insn.
	(*floatsi<mode>2_vector_mixed): Ditto.
	(*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit): Ditto.
	(*float<SSEMODEI24:mode><MODEF:mode>2_mixed_nointerunit): Ditto.
	(*float<SSEMODEI24:mode><X87MODEF:mode>2_i387_with_temp): Ditto.
	(*float<SSEMODEI24:mode><X87MODEF:mode>2_i387): Ditto.
	* config/i386/gas.h (GAS_MNEMONICS): Remove.

From-SVN: r146761
This commit is contained in:
Uros Bizjak 2009-04-25 10:10:51 +02:00
parent fd24db293b
commit a3a5e3d16c
7 changed files with 177 additions and 96 deletions

View File

@ -1,3 +1,25 @@
2009-04-25 Uros Bizjak <ubizjak@gmail.com>
H.J. Lu <hongjiu.lu@intel.com>
PR target/39590
* configure.ac (HAVE_AS_IX86_FILDQ): On x86 targets check whether
the configured assembler supports fildq and fistpq mnemonics.
(HAVE_AS_IX86_FILDS): Rename from HAVE_GAS_FILDS_FISTS.
* configure: Regenerated.
* config.in: Ditto.
* config/i386/i386.c (print_operand): Handle 'Z'.
['z']: Remove handling of special fild/fist suffixes.
(output_fix_trunc): Use '%Z' to output suffix of fist{,p,tp} insn.
* config/i386/i386.md (*floathi<mode>2_i387): Use '%Z' to output
suffix of fild insn.
(*floatsi<mode>2_vector_mixed): Ditto.
(*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit): Ditto.
(*float<SSEMODEI24:mode><MODEF:mode>2_mixed_nointerunit): Ditto.
(*float<SSEMODEI24:mode><X87MODEF:mode>2_i387_with_temp): Ditto.
(*float<SSEMODEI24:mode><X87MODEF:mode>2_i387): Ditto.
* config/i386/gas.h (GAS_MNEMONICS): Remove.
2009-04-25 Ben Elliston <bje@au.ibm.com>
* genrecog.c (validate_pattern): Do not warn for VOIDmode CALLs as
@ -82,10 +104,8 @@
(enum dwarf_source_language): Likewise.
* dwarf2out.c (int_loc_descriptor): Add cast to enum type.
(add_calling_convention_attribute): Likewise.
* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
type.
(combine_comparisons): Change compcode to int. Add cast to enum
type.
* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type.
(combine_comparisons): Change compcode to int. Add cast to enum type.
* genrecog.c (maybe_both_true_2): Change c to int.
(write_switch): Likewise. Add cast to enum type.
* gimplify.c (gimplify_omp_for): Handle return values from
@ -93,8 +113,8 @@
(gimplify_expr): Add cast to enum type.
* ipa-prop.c (update_jump_functions_after_inlining): Change
IPA_BOTTOM to IPA_JF_UNKNOWN.
* ira.c (setup_class_subset_and_memory_move_costs): Change mode to
int. Add casts to enum type.
* ira.c (setup_class_subset_and_memory_move_costs): Change mode to int.
Add casts to enum type.
(setup_cover_and_important_classes): Change cl to int. Add casts
to enum type.
(setup_class_translate): Change cl and mode to int.
@ -126,14 +146,12 @@
with ERROR_MARK, not NUM_TREE_CODES.
(vect_create_epilog_for_reduction): Likewise.
(vectorizable_reduction): Don't initialize epiloc_reduc_code.
When not using it, set it to ERROR_MARK rather than
NUM_TREE_CODES.
When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES.
* tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to
enum machine_mode.
* tree-vect-stmts.c (new_stmt_vec_info): Change 0 to
vect_unused_in_loop. Change 0 to loop_vect.
* tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum
type.
* tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type.
* var-tracking.c (get_init_value): Change return type to enum
var_init_status.
* vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
@ -203,8 +221,7 @@
* config/frv/frv.c (frv_frame_access): Do not use reg+reg
addressing for DImode accesses.
(frv_print_operand_address): Handle PLUS case.
* config/frv/frv.h (FIXED_REGISTERS): Mark link register as
fixed.
* config/frv/frv.h (FIXED_REGISTERS): Mark link register as fixed.
2009-04-24 Jakub Jelinek <jakub@redhat.com>

View File

@ -273,6 +273,18 @@
#endif
/* Define if your assembler uses fildq and fistq mnemonics. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_IX86_FILDQ
#endif
/* Define if your assembler uses filds and fists mnemonics. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_IX86_FILDS
#endif
/* Define if your assembler supports the sahf mnemonic. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_IX86_SAHF
@ -844,12 +856,6 @@
#endif
/* Define if your assembler uses the new HImode fild and fist notation. */
#ifndef USED_FOR_TARGET
#undef HAVE_GAS_FILDS_FISTS
#endif
/* Define if your assembler and linker support .hidden. */
#undef HAVE_GAS_HIDDEN

View File

@ -117,9 +117,6 @@ along with GCC; see the file COPYING3. If not see
#undef SHIFT_DOUBLE_OMITS_COUNT
#define SHIFT_DOUBLE_OMITS_COUNT 0
/* Print opcodes the way that GAS expects them. */
#define GAS_MNEMONICS 1
/* The comment-starter string as GAS expects it. */
#undef ASM_COMMENT_START
#define ASM_COMMENT_START "#"

View File

@ -10848,6 +10848,7 @@ get_some_local_dynamic_name (void)
otherwise nothing
R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand.
Z -- likewise, with special suffixes for fild/fist instructions.
* -- print a star (in certain assembler syntax)
A -- print an absolute memory reference.
w -- print the operand as if it's a "word" (HImode) even if it isn't.
@ -10946,6 +10947,37 @@ print_operand (FILE *file, rtx x, int code)
putc ('t', file);
return;
case 'Z':
gcc_assert (MEM_P (x));
/* fild/fist don't get size suffixes if using Intel opcodes. */
if (ASSEMBLER_DIALECT == ASM_INTEL)
return;
switch (GET_MODE_SIZE (GET_MODE (x)))
{
case 2:
#ifdef HAVE_AS_IX86_FILDS
putc ('s', file);
#endif
return;
case 4:
putc ('l', file);
return;
case 8:
#ifdef HAVE_AS_IX86_FILDQ
putc ('q', file);
#else
fputs ("ll", file);
#endif
return;
default:
gcc_unreachable ();
}
case 'z':
/* 387 opcodes don't get size suffixes if the operands are
registers. */
@ -10964,25 +10996,21 @@ print_operand (FILE *file, rtx x, int code)
return;
case 2:
if (MEM_P (x))
{
#ifdef HAVE_GAS_FILDS_FISTS
putc ('s', file);
#endif
return;
}
else
putc ('w', file);
putc ('w', file);
return;
case 4:
if (GET_MODE (x) == SFmode)
{
putc ('s', file);
return;
}
else
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
putc ('l', file);
else
putc ('s', file);
return;
case 8:
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
putc ('q', file);
else
putc ('l', file);
return;
case 12:
@ -10990,25 +11018,6 @@ print_operand (FILE *file, rtx x, int code)
putc ('t', file);
return;
case 8:
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
{
if (MEM_P (x))
{
#ifdef GAS_MNEMONICS
putc ('q', file);
#else
putc ('l', file);
putc ('l', file);
#endif
}
else
putc ('q', file);
}
else
putc ('l', file);
return;
default:
gcc_unreachable ();
}
@ -12089,15 +12098,15 @@ output_fix_trunc (rtx insn, rtx *operands, int fisttp)
gcc_assert (GET_MODE (operands[1]) != TFmode);
if (fisttp)
output_asm_insn ("fisttp%z0\t%0", operands);
output_asm_insn ("fisttp%Z0\t%0", operands);
else
{
if (round_mode != I387_CW_ANY)
output_asm_insn ("fldcw\t%3", operands);
if (stack_top_dies || dimode_p)
output_asm_insn ("fistp%z0\t%0", operands);
output_asm_insn ("fistp%Z0\t%0", operands);
else
output_asm_insn ("fist%z0\t%0", operands);
output_asm_insn ("fist%Z0\t%0", operands);
if (round_mode != I387_CW_ANY)
output_asm_insn ("fldcw\t%2", operands);
}

View File

@ -27,22 +27,39 @@
;; See file "rtl.def" for documentation on define_insn, match_*, et. al.
;;
;; The special asm out single letter directives following a '%' are:
;; 'z' mov%z1 would be movl, movw, or movb depending on the mode of
;; operands[1].
;; 'L' Print the opcode suffix for a 32-bit integer opcode.
;; 'W' Print the opcode suffix for a 16-bit integer opcode.
;; 'B' Print the opcode suffix for an 8-bit integer opcode.
;; 'Q' Print the opcode suffix for a 64-bit float opcode.
;; 'S' Print the opcode suffix for a 32-bit float opcode.
;; 'T' Print the opcode suffix for an 80-bit extended real XFmode float opcode.
;; 'J' Print the appropriate jump operand.
;;
;; 'b' Print the QImode name of the register for the indicated operand.
;; %b0 would print %al if operands[0] is reg 0.
;; 'w' Likewise, print the HImode name of the register.
;; 'k' Likewise, print the SImode name of the register.
;; 'h' Print the QImode name for a "high" register, either ah, bh, ch or dh.
;; 'y' Print "st(0)" instead of "st" as a register.
;; L,W,B,Q,S,T -- print the opcode suffix for specified size of operand.
;; C -- print opcode suffix for set/cmov insn.
;; c -- like C, but print reversed condition
;; E,e -- likewise, but for compare-and-branch fused insn.
;; F,f -- likewise, but for floating-point.
;; O -- if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.",
;; otherwise nothing
;; R -- print the prefix for register names.
;; z -- print the opcode suffix for the size of the current operand.
;; Z -- likewise, with special suffixes for fild/fist instructions.
;; * -- print a star (in certain assembler syntax)
;; A -- print an absolute memory reference.
;; w -- print the operand as if it's a "word" (HImode) even if it isn't.
;; s -- print a shift double count, followed by the assemblers argument
;; delimiter.
;; b -- print the QImode name of the register for the indicated operand.
;; %b0 would print %al if operands[0] is reg 0.
;; w -- likewise, print the HImode name of the register.
;; k -- likewise, print the SImode name of the register.
;; q -- likewise, print the DImode name of the register.
;; x -- likewise, print the V4SFmode name of the register.
;; t -- likewise, print the V8SFmode name of the register.
;; h -- print the QImode name for a "high" register, either ah, bh, ch or dh.
;; y -- print "st(0)" instead of "st" as a register.
;; d -- print duplicated register operand for AVX instruction.
;; D -- print condition for SSE cmp instruction.
;; P -- if PIC, print an @PLT suffix.
;; X -- don't print any sort of PIC '@' suffix for a symbol.
;; & -- print some in-use local-dynamic symbol name.
;; H -- print a memory address offset by 8; used for sse high-parts
;; Y -- print condition for SSE5 com* instruction.
;; + -- print a branch hint as 'cs' or 'ds' prefix
;; ; -- print a semicolon (after prefixes due to bug in older gas).
;; UNSPEC usage:
@ -5124,7 +5141,7 @@
"TARGET_80387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)"
"fild%z1\t%1"
"fild%Z1\t%1"
[(set_attr "type" "fmov")
(set_attr "mode" "<MODE>")
(set_attr "fp_int_src" "true")])
@ -5234,7 +5251,7 @@
"TARGET_SSE2 && TARGET_MIX_SSE_I387
&& TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)"
"@
fild%z1\t%1
fild%Z1\t%1
#"
[(set_attr "type" "fmov,sseicvt")
(set_attr "mode" "<MODE>,<ssevecmode>")
@ -5295,7 +5312,7 @@
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
&& (TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
"@
fild%z1\t%1
fild%Z1\t%1
%vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}
%vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "fmov,sseicvt,sseicvt")
@ -5314,7 +5331,7 @@
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
&& !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
"@
fild%z1\t%1
fild%Z1\t%1
%vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "fmov,sseicvt")
(set_attr "prefix" "orig,maybe_vex")
@ -5564,7 +5581,7 @@
"TARGET_80387
&& X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, <SSEMODEI24:MODE>mode)"
"@
fild%z1\t%1
fild%Z1\t%1
#"
[(set_attr "type" "fmov,multi")
(set_attr "mode" "<X87MODEF:MODE>")
@ -5577,7 +5594,7 @@
(match_operand:SSEMODEI24 1 "memory_operand" "m")))]
"TARGET_80387
&& X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, <SSEMODEI24:MODE>mode)"
"fild%z1\t%1"
"fild%Z1\t%1"
[(set_attr "type" "fmov")
(set_attr "mode" "<X87MODEF:MODE>")
(set_attr "fp_int_src" "true")])

53
gcc/configure vendored
View File

@ -22638,15 +22638,11 @@ fi
echo "$as_me:$LINENO: checking assembler for filds and fists mnemonics" >&5
echo $ECHO_N "checking assembler for filds and fists mnemonics... $ECHO_C" >&6
if test "${gcc_cv_as_ix86_filds_fists+set}" = set; then
if test "${gcc_cv_as_ix86_filds+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gcc_cv_as_ix86_filds_fists=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
then gcc_cv_as_ix86_filds_fists=yes
fi
elif test x$gcc_cv_as != x; then
gcc_cv_as_ix86_filds=no
if test x$gcc_cv_as != x; then
echo 'filds mem; fists mem' > conftest.s
if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
@ -22655,7 +22651,7 @@ fi
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }
then
gcc_cv_as_ix86_filds_fists=yes
gcc_cv_as_ix86_filds=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
@ -22663,12 +22659,45 @@ fi
rm -f conftest.o conftest.s
fi
fi
echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_filds_fists" >&5
echo "${ECHO_T}$gcc_cv_as_ix86_filds_fists" >&6
if test $gcc_cv_as_ix86_filds_fists = yes; then
echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_filds" >&5
echo "${ECHO_T}$gcc_cv_as_ix86_filds" >&6
if test $gcc_cv_as_ix86_filds = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GAS_FILDS_FISTS 1
#define HAVE_AS_IX86_FILDS 1
_ACEOF
fi
echo "$as_me:$LINENO: checking assembler for fildq and fistpq mnemonics" >&5
echo $ECHO_N "checking assembler for fildq and fistpq mnemonics... $ECHO_C" >&6
if test "${gcc_cv_as_ix86_fildq+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gcc_cv_as_ix86_fildq=no
if test x$gcc_cv_as != x; then
echo 'fildq mem; fistpq mem' > conftest.s
if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }
then
gcc_cv_as_ix86_fildq=yes
else
echo "configure: failed program was" >&5
cat conftest.s >&5
fi
rm -f conftest.o conftest.s
fi
fi
echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_fildq" >&5
echo "${ECHO_T}$gcc_cv_as_ix86_fildq" >&6
if test $gcc_cv_as_ix86_fildq = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_AS_IX86_FILDQ 1
_ACEOF
fi

View File

@ -2931,10 +2931,16 @@ foo: nop
esac
gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
gcc_cv_as_ix86_filds_fists,
[2,9,0],, [filds mem; fists mem],,
[AC_DEFINE(HAVE_GAS_FILDS_FISTS, 1,
[Define if your assembler uses the new HImode fild and fist notation.])])
gcc_cv_as_ix86_filds,,,
[filds mem; fists mem],,
[AC_DEFINE(HAVE_AS_IX86_FILDS, 1,
[Define if your assembler uses filds and fists mnemonics.])])
gcc_GAS_CHECK_FEATURE([fildq and fistpq mnemonics],
gcc_cv_as_ix86_fildq,,,
[fildq mem; fistpq mem],,
[AC_DEFINE(HAVE_AS_IX86_FILDQ, 1,
[Define if your assembler uses fildq and fistq mnemonics.])])
gcc_GAS_CHECK_FEATURE([cmov syntax],
gcc_cv_as_ix86_cmov_sun_syntax,,,