From: uros Date: Sat, 25 Apr 2009 08:10:51 +0000 (+0000) Subject: PR target/39590 X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=6cc62ffae9ccd068658004d535439e06c20d590b 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 (*floathi2_i387): Use '%Z' to output suffix of fild insn. (*floatsi2_vector_mixed): Ditto. (*float2_mixed_interunit): Ditto. (*float2_mixed_nointerunit): Ditto. (*float2_i387_with_temp): Ditto. (*float2_i387): Ditto. * config/i386/gas.h (GAS_MNEMONICS): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146761 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ebf110e982..fdefcf10127 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2009-04-25 Uros Bizjak + H.J. Lu + + 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 (*floathi2_i387): Use '%Z' to output + suffix of fild insn. + (*floatsi2_vector_mixed): Ditto. + (*float2_mixed_interunit): Ditto. + (*float2_mixed_nointerunit): Ditto. + (*float2_i387_with_temp): Ditto. + (*float2_i387): Ditto. + * config/i386/gas.h (GAS_MNEMONICS): Remove. + 2009-04-25 Ben Elliston * 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 diff --git a/gcc/config.in b/gcc/config.in index f45ea338a4c..9cbae32cd4d 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -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 diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h index f3d43b31ea2..c4dafc64d18 100644 --- a/gcc/config/i386/gas.h +++ b/gcc/config/i386/gas.h @@ -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 "#" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ab851dc00c9..65ee05c81b5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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,51 +10996,28 @@ 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); - return; - - case 12: - case 16: - putc ('t', file); + else + putc ('s', 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); - } + putc ('q', file); else putc ('l', file); return; + case 12: + case 16: + putc ('t', 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); } diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 777a72cb9a6..d315580139c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -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) && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)" - "fild%z1\t%1" + "fild%Z1\t%1" [(set_attr "type" "fmov") (set_attr "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" ",") @@ -5295,7 +5312,7 @@ && SSE_FLOAT_MODE_P (mode) && TARGET_MIX_SSE_I387 && (TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))" "@ - fild%z1\t%1 + fild%Z1\t%1 %vcvtsi2s\t{%1, %d0|%d0, %1} %vcvtsi2s\t{%1, %d0|%d0, %1}" [(set_attr "type" "fmov,sseicvt,sseicvt") @@ -5314,7 +5331,7 @@ && SSE_FLOAT_MODE_P (mode) && TARGET_MIX_SSE_I387 && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))" "@ - fild%z1\t%1 + fild%Z1\t%1 %vcvtsi2s\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 (mode, mode)" "@ - fild%z1\t%1 + fild%Z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "") @@ -5577,7 +5594,7 @@ (match_operand:SSEMODEI24 1 "memory_operand" "m")))] "TARGET_80387 && X87_ENABLE_FLOAT (mode, mode)" - "fild%z1\t%1" + "fild%Z1\t%1" [(set_attr "type" "fmov") (set_attr "mode" "") (set_attr "fp_int_src" "true")]) diff --git a/gcc/configure b/gcc/configure index 6d1b6e0000e..2415a6cb2d9 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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,40 @@ 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 + fi + rm -f conftest.o conftest.s + fi +fi +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_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 @@ -22663,12 +22692,12 @@ 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_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_GAS_FILDS_FISTS 1 +#define HAVE_AS_IX86_FILDQ 1 _ACEOF fi diff --git a/gcc/configure.ac b/gcc/configure.ac index 51e1a74b543..849b856f9c9 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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,,,