[Mono-bugs] [Bug 60069][Wis] New - We dont use shortest encoding for negative long constants
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 00:45:45 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=60069
--- shadow/60069 2004-06-12 00:45:45.000000000 -0400
+++ shadow/60069.tmp.8687 2004-06-12 00:45:45.000000000 -0400
@@ -0,0 +1,34 @@
+Bug#: 60069
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bmaurer@users.sf.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: We dont use shortest encoding for negative long constants
+
+Consider
+
+class T {
+ static void Main () {
+ const long a = -1;
+ System.Console.WriteLine (a);
+ }
+}
+
+We generate
+
+ IL_0000: ldc.i8 0xffffffffffffffff
+ IL_0009: call void class
+[mscorlib]'System.Console'::'WriteLine'(int64) IL_000e: ret
+
+But it would be shorter to ldc.i4.m1 / conv.i8.