From 19425621a5fd836bff16eb656123701a8e44648e Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 20 Jun 2012 21:28:07 +0200 Subject: [PATCH] i386.md (SINCOS): New int iterator. 2012-06-20 Uros Bizjak * config/i386/i386.md (SINCOS): New int iterator. (sincos): New int attribute. (*xf2_i387): Macroize insn from *{sin,cos}xf2_i387 using SINCOS int iterator. (*_extendxf2_i387): Macroize insn from *{sin,cos}_extendxf2_i387 using SINCOS int iterator. 2012-06-20 Uros Bizjak * config/i386/i386.md (RDFSGSBASE): New int iterator. (WRFSGSBASE): Ditto. (fsgs): New int attribute. (rdbase): Macroize insn from rdbase using RDFSGSBASE int iterator. (wrbase): Macroize insn from wrbase using WRFSGSBASE int iterator. From-SVN: r188843 --- gcc/ChangeLog | 21 +++++++++- gcc/config/i386/i386.md | 85 +++++++++++++++++------------------------ 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50bf3289acf..543be452a17 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,25 @@ * tree.h (DECL_SOURCE_COLUMN): New accessor. +2012-06-20 Uros Bizjak + + * config/i386/i386.md (SINCOS): New int iterator. + (sincos): New int attribute. + (*xf2_i387): Macroize insn from *{sin,cos}xf2_i387 using + SINCOS int iterator. + (*_extendxf2_i387): Macroize insn from + *{sin,cos}_extendxf2_i387 using SINCOS int iterator. + +2012-06-20 Uros Bizjak + + * config/i386/i386.md (RDFSGSBASE): New int iterator. + (WRFSGSBASE): Ditto. + (fsgs): New int attribute. + (rdbase): Macroize insn from rdbase using + RDFSGSBASE int iterator. + (wrbase): Macroize insn from wrbase using + WRFSGSBASE int iterator. + 2012-06-20 Uros Bizjak * config/i386/i386.md (2): Macroize expander @@ -38,7 +57,7 @@ * config/i386/i386.md (IEEE_MAXMIN): New int iterator. (ieee_maxmin): New int attribute. (*ieee_s3): Macroize insn from - *ieee_s{max,min}3 using IEEE_MAXMIN mode iterator. + *ieee_s{max,min}3 using IEEE_MAXMIN int iterator. 2012-06-20 Steven Bosscher diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a74fdc0678d..879b87b3447 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13863,47 +13863,34 @@ DONE; }) -(define_insn "*sinxf2_i387" +(define_int_iterator SINCOS + [UNSPEC_SIN + UNSPEC_COS]) + +(define_int_attr sincos + [(UNSPEC_SIN "sin") + (UNSPEC_COS "cos")]) + +(define_insn "*xf2_i387" [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_SIN))] + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + SINCOS))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" - "fsin" + "f" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) -(define_insn "*sin_extendxf2_i387" +(define_insn "*_extendxf2_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(float_extend:XF (match_operand:MODEF 1 "register_operand" "0"))] - UNSPEC_SIN))] + SINCOS))] "TARGET_USE_FANCY_MATH_387 && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" - "fsin" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*cosxf2_i387" - [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_COS))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "fcos" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF")]) - -(define_insn "*cos_extendxf2_i387" - [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(float_extend:XF - (match_operand:MODEF 1 "register_operand" "0"))] - UNSPEC_COS))] - "TARGET_USE_FANCY_MATH_387 - && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) - || TARGET_MIX_SSE_I387) - && flag_unsafe_math_optimizations" - "fcos" + "f" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) @@ -18087,35 +18074,33 @@ (set (attr "length") (symbol_ref "ix86_attr_length_address_default (insn) + 9"))]) -(define_insn "rdfsbase" +(define_int_iterator RDFSGSBASE + [UNSPECV_RDFSBASE + UNSPECV_RDGSBASE]) + +(define_int_iterator WRFSGSBASE + [UNSPECV_WRFSBASE + UNSPECV_WRGSBASE]) + +(define_int_attr fsgs + [(UNSPECV_RDFSBASE "fs") + (UNSPECV_RDGSBASE "gs") + (UNSPECV_WRFSBASE "fs") + (UNSPECV_WRGSBASE "gs")]) + +(define_insn "rdbase" [(set (match_operand:SWI48 0 "register_operand" "=r") - (unspec_volatile:SWI48 [(const_int 0)] UNSPECV_RDFSBASE))] + (unspec_volatile:SWI48 [(const_int 0)] RDFSGSBASE))] "TARGET_64BIT && TARGET_FSGSBASE" - "rdfsbase %0" + "rdbase\t%0" [(set_attr "type" "other") (set_attr "prefix_extra" "2")]) -(define_insn "rdgsbase" - [(set (match_operand:SWI48 0 "register_operand" "=r") - (unspec_volatile:SWI48 [(const_int 0)] UNSPECV_RDGSBASE))] - "TARGET_64BIT && TARGET_FSGSBASE" - "rdgsbase %0" - [(set_attr "type" "other") - (set_attr "prefix_extra" "2")]) - -(define_insn "wrfsbase" +(define_insn "wrbase" [(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")] - UNSPECV_WRFSBASE)] + WRFSGSBASE)] "TARGET_64BIT && TARGET_FSGSBASE" - "wrfsbase %0" - [(set_attr "type" "other") - (set_attr "prefix_extra" "2")]) - -(define_insn "wrgsbase" - [(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")] - UNSPECV_WRGSBASE)] - "TARGET_64BIT && TARGET_FSGSBASE" - "wrgsbase %0" + "wrbase\t%0" [(set_attr "type" "other") (set_attr "prefix_extra" "2")])