diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2014-05-16 09:23:28 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2014-05-16 09:23:28 +0000 |
commit | fb620c4a9a2120478ce4d6c9fc09826d39c89529 (patch) | |
tree | a85cf9a98df95220f4698e01385deb53286842ce /gcc | |
parent | b292109f9ec580c1b81e4b39388cb0d315318d7e (diff) | |
download | gcc-fb620c4a9a2120478ce4d6c9fc09826d39c89529.zip gcc-fb620c4a9a2120478ce4d6c9fc09826d39c89529.tar.gz gcc-fb620c4a9a2120478ce4d6c9fc09826d39c89529.tar.bz2 |
[AArch64 costs 16/18] Cost TRUNCATE
gcc/
* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost TRUNCATE.
Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
From-SVN: r210508
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 33 |
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4e6b18..3515c6c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,11 @@ 2014-05-16 James Greenhalgh <james.greenhalgh@arm.com> Philipp Tomsich <philipp.tomsich@theobroma-systems.com> + * config/aarch64/aarch64.c (aarch64_rtx_costs): Cost TRUNCATE. + +2014-05-16 James Greenhalgh <james.greenhalgh@arm.com> + Philipp Tomsich <philipp.tomsich@theobroma-systems.com> + * config/aarch64/aarch64.c (aarch64_rtx_costs): Cost FMA, FLOAT_EXTEND, FLOAT_TRUNCATE, ABS, SMAX, and SMIN. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 503f914..58627b5 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5724,6 +5724,39 @@ cost_plus: } return false; + case TRUNCATE: + + /* Decompose <su>muldi3_highpart. */ + if (/* (truncate:DI */ + mode == DImode + /* (lshiftrt:TI */ + && GET_MODE (XEXP (x, 0)) == TImode + && GET_CODE (XEXP (x, 0)) == LSHIFTRT + /* (mult:TI */ + && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT + /* (ANY_EXTEND:TI (reg:DI)) + (ANY_EXTEND:TI (reg:DI))) */ + && ((GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == ZERO_EXTEND + && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == ZERO_EXTEND) + || (GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == SIGN_EXTEND + && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == SIGN_EXTEND)) + && GET_MODE (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 0)) == DImode + && GET_MODE (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 1), 0)) == DImode + /* (const_int 64) */ + && CONST_INT_P (XEXP (XEXP (x, 0), 1)) + && UINTVAL (XEXP (XEXP (x, 0), 1)) == 64) + { + /* UMULH/SMULH. */ + if (speed) + *cost += extra_cost->mult[mode == DImode].extend; + *cost += rtx_cost (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 0), + MULT, 0, speed); + *cost += rtx_cost (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 1), 0), + MULT, 1, speed); + return true; + } + + /* Fall through. */ default: break; } |