[前][次][番号順一覧][スレッド一覧][生データ]

yarv-diff:365

From: ko1 atdot.net
Date: 15 Aug 2006 15:09:18 +0900
Subject: [yarv-diff:365] r532 - in trunk: . yarvtest

Author: ko1
Date: 2006-08-15 15:09:17 +0900 (Tue, 15 Aug 2006)
New Revision: 532

Modified:
   trunk/
   trunk/ChangeLog
   trunk/insns.def
   trunk/yarvtest/test_opts.rb
Log:
 r825@lermite:  ko1 | 2006-08-15 15:08:48 +0900
 	* insns.def : fix opt_plus routine ([yarv-dev-en:149])
 
 	* yarvtest/test_opts.rb : add tests for above
 



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:823
   + 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:825

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-08-14 07:54:04 UTC (rev 531)
+++ trunk/ChangeLog	2006-08-15 06:09:17 UTC (rev 532)
@@ -4,6 +4,13 @@
 #  from Mon, 03 May 2004 01:24:19 +0900
 #
 
+2006-08-15(Tue) 15:07:43 +0900  Koichi Sasada  <ko1 atdot.net>
+
+	* insns.def : fix opt_plus routine ([yarv-dev-en:149])
+
+	* yarvtest/test_opts.rb : add tests for above
+
+
 2006-08-06(Sun) 06:24:51 +0900  Koichi Sasada  <ko1 atdot.net>
 
 	* common.mk : fix build rule (build only ruby binary when benchmark)

Modified: trunk/insns.def
===================================================================
--- trunk/insns.def	2006-08-14 07:54:04 UTC (rev 531)
+++ trunk/insns.def	2006-08-15 06:09:17 UTC (rev 532)
@@ -1608,9 +1608,10 @@
 	     BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
 	/* fixnum + fixnum */
 	val = (recv + (obj & (~1)));
-	if ((~(recv ^ obj) & (recv ^ val)) & 0x80000000) {
-	    val = rb_big_plus(rb_int2big(INT2FIX(recv)),
-			      rb_int2big(INT2FIX(obj)));
+	if ((~(recv ^ obj) & (recv ^ val)) &
+	    (0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
+	    val = rb_big_plus(rb_int2big(FIX2INT(recv)),
+			      rb_int2big(FIX2INT(obj)));
 	}
     }
 #endif

Modified: trunk/yarvtest/test_opts.rb
===================================================================
--- trunk/yarvtest/test_opts.rb	2006-08-14 07:54:04 UTC (rev 531)
+++ trunk/yarvtest/test_opts.rb	2006-08-15 06:09:17 UTC (rev 532)
@@ -81,6 +81,23 @@
       }
     }
   end
+
+  def test_opt_plus
+    ae %q{
+      temp = 2**30 - 5
+      (1..5).map do
+        temp += 1
+        [temp, temp.class]
+      end
+    }
+    ae %q{
+      temp = -(2**30 - 5)
+      (1..10).map do
+        temp += 1
+        [temp, temp.class]
+      end
+    }
+  end
 end
 
 


--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]