[AArch64 costs 4/18] Better estimate cost of building a constant

James Greenhalgh james.greenhalgh@arm.com
Thu Mar 27 17:34:00 GMT 2014


Hi,

One thing we might want to be more accurate in costing is building
an integer from scratch.

To estimate this, we can repurpose aarch64_build_constant. If we
take an additional flag to decide whether we should actually emit
instructions, we can simply count the number of instructions we would
have spat out, and use that count.

This patch performs that modification, updates the existing
call-sites for aarch64_build_constant, and adds code to
aarch64_rtx_costs to cost a CONST_INT or a CONST_DOUBLE.

Tested in series on aarch64-none-elf with no issues.

OK for stage 1?

Thanks,
James

---
2014-03-27  James Greenhalgh  <james.greenhalgh@arm.com>
	    Philipp Tomsich  <philipp.tomsich@theobroma-systems.com>

	* config/aarch64/aarch64.c (aarch64_build_constant): Conditionally
	emit instructions, return number of instructions which would
	be emitted.
	(aarch64_add_constant): Update call to aarch64_build_constant.
	(aarch64_output_mi_thunk): Likewise.
	(aarch64_rtx_costs): Estimate cost of a CONST_INT, cost
	a CONST_DOUBLE.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-AArch64-costs-4-18-Better-estimate-cost-of-building-.patch
Type: text/x-patch
Size: 4955 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140327/716cafd2/attachment.bin>


More information about the Gcc-patches mailing list