diff options
author | ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-10 17:29:46 +0000 |
---|---|---|
committer | ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-10 17:29:46 +0000 |
commit | ef4899273a734f65cb45b09222fab75bc515482a (patch) | |
tree | e6ef0e746a890fa07e3ba05f86607d2ffe30695e | |
parent | 39d83642f9c780255059d67e9ea18725d274cd09 (diff) | |
download | gcc-ef4899273a734f65cb45b09222fab75bc515482a.tar.gz |
[ARM] Fix costing of vmul+vcvt combine pattern
* config/arm/arm.c (arm_new_rtx_costs, FIX case): Handle
combine_vcvtf2i pattern.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230116 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07f574f17b1..5eca05d37ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2015-11-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + * config/arm/arm.c (arm_new_rtx_costs, FIX case): Handle + combine_vcvtf2i pattern. + +2015-11-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + * config/arm/arm.c (neon_valid_immediate): Remove integer CONST_DOUBLE handling. It should never occur. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f5c88253204..736e6c8f025 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -11049,6 +11049,23 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, case UNSIGNED_FIX: if (TARGET_HARD_FLOAT) { + /* The *combine_vcvtf2i reduces a vmul+vcvt into + a vcvt fixed-point conversion. */ + if (code == FIX && mode == SImode + && GET_CODE (XEXP (x, 0)) == FIX + && GET_MODE (XEXP (x, 0)) == SFmode + && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT + && vfp3_const_double_for_bits (XEXP (XEXP (XEXP (x, 0), 0), 1)) + > 0) + { + if (speed_p) + *cost += extra_cost->fp[0].toint; + + *cost += rtx_cost (XEXP (XEXP (XEXP (x, 0), 0), 0), mode, + code, 0, speed_p); + return true; + } + if (GET_MODE_CLASS (mode) == MODE_INT) { mode = GET_MODE (XEXP (x, 0)); |