Bug 315462 (MONO61442) - [PATCH] use cmp DWORD PTR [eax], eax for null check
Summary: [PATCH] use cmp DWORD PTR [eax], eax for null check
Status: RESOLVED FIXED
Alias: MONO61442
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-12 20:45 UTC by Ben Maurer
Modified: 2007-09-15 21:24 UTC (History)
0 users

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


Attachments
mini-cmp-dword-ptr-eax-eax.patch (613 bytes, patch)
2004-07-12 20:46 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:37 UTC


---- Reported by bmaurer@users.sf.net 2004-07-12 13:45:35 MST ----

Today we use the instruction:

cmp DWORD PTR [eax], 0

to do a null check. This instuction is minimally encoded in three bytes.
However, the instruction:

cmp DWORD PTR [eax], eax

Can be encoded in 2 bytes. I ran some benchmarks on my Pentium M and the
two instructions had the same performance. Microsoft's jit emits the cmp
DWORD PTR [eax], eax instruction.

This patch lets us use the shorter form.



---- Additional Comments From bmaurer@users.sf.net 2004-07-12 13:46:02 MST ----

Created an attachment (id=166444)
mini-cmp-dword-ptr-eax-eax.patch




---- Additional Comments From bmaurer@users.sf.net 2004-07-12 13:56:32 MST ----

its in

Imported an attachment (id=166444)

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