Bug 315464 (MONO61450) - [PATCH] use xor esi, esi to set a regvar to 0
Summary: [PATCH] use xor esi, esi to set a regvar to 0
Status: RESOLVED FIXED
Alias: MONO61450
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-12 22:06 UTC by Ben Maurer
Modified: 2007-09-15 21:24 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
mini-xor-esi-esi.patch (1.85 KB, patch)
2004-07-12 22:06 UTC, Thomas Wiest
Details | Diff
Other changes to the burg file have caused conflicts. Same patch, the context has changed. (1.87 KB, patch)
2004-07-29 21:41 UTC, Thomas Wiest
Details | Diff
newer patch (988 bytes, patch)
2004-07-29 22:14 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:46:38 UTC


---- Reported by bmaurer@users.sf.net 2004-07-12 15:06:20 MST ----

This patch uses the shorter xor esi, esi encoding when we set a regvar to
zero. Before, we only did this as a peephole opt. The problem with this
method is that the flow of cflags information is not clear from the
instructions.

My patch does the optimization at the tree level. We know that cflags are
not propagated from one tree to another. Thus, if we see stind.x (regvar,
iconst [0]), we know we can use the xor encoding.



---- Additional Comments From bmaurer@users.sf.net 2004-07-12 15:06:40 MST ----

Created an attachment (id=166446)
mini-xor-esi-esi.patch




---- Additional Comments From miguel@ximian.com 2004-07-17 01:13:18 MST ----

CCing Zoltan to get authorization about this patch.



---- Additional Comments From bmaurer@users.sf.net 2004-07-29 14:41:51 MST ----

Created an attachment (id=166447)
Other changes to the burg file have caused conflicts. Same patch, the context has changed.




---- Additional Comments From bmaurer@users.sf.net 2004-07-29 15:14:01 MST ----

Created an attachment (id=166448)
newer patch




---- Additional Comments From bmaurer@users.sf.net 2004-07-29 15:15:27 MST ----

The old patch prevented the following rules from being used:

 stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST),
 stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST),
 stmt: CEE_STIND_REF (OP_REGVAR, OP_ICONST),
 stmt: CEE_STIND_I (OP_REGVAR, OP_ICONST)

because the engine would choose to load the constant into a register
(as that also had a cost of two.

The newer version of the patch just makes the xor rule a zero cost rule.



---- Additional Comments From vargaz@freemail.hu 2004-08-07 16:15:29 MST ----

This is ok to check in.

Imported an attachment (id=166446)
Imported an attachment (id=166447)
Imported an attachment (id=166448)

Unknown operating system unknown. Setting to default OS "Other".