浏览代码

Merge branch 'master' of https://github.com/odin-lang/Odin

gingerBill 4 年之前
父节点
当前提交
326e5cd046
共有 4 个文件被更改,包括 6 次插入3 次删除
  1. 1 1
      core/math/big/build.bat
  2. 0 0
      core/math/big/example.odin
  3. 4 2
      core/math/big/internal.odin
  4. 1 0
      core/math/big/private.odin

+ 1 - 1
core/math/big/build.bat

@@ -1,5 +1,5 @@
 @echo off
 @echo off
-:odin run . -vet -o:speed -no-bounds-check
+:odin run . -vet -o:size
 : -o:size
 : -o:size
 :odin build . -build-mode:shared -show-timings -o:minimal -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
 :odin build . -build-mode:shared -show-timings -o:minimal -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
 :odin build . -build-mode:shared -show-timings -o:size -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests
 :odin build . -build-mode:shared -show-timings -o:size -no-bounds-check -define:MATH_BIG_EXE=false && python test.py -fast-tests

文件差异内容过多而无法显示
+ 0 - 0
core/math/big/example.odin


+ 4 - 2
core/math/big/internal.odin

@@ -630,6 +630,8 @@ internal_int_mul :: proc(dest, src, multiplier: ^Int, allocator := context.alloc
 	*/
 	*/
 	if multiplier.used == 0 || src.used == 0 { return internal_zero(dest); }
 	if multiplier.used == 0 || src.used == 0 { return internal_zero(dest); }
 
 
+	neg := src.sign != multiplier.sign;
+
 	if src == multiplier {
 	if src == multiplier {
 		/*
 		/*
 			Do we need to square?
 			Do we need to square?
@@ -674,7 +676,7 @@ internal_int_mul :: proc(dest, src, multiplier: ^Int, allocator := context.alloc
 			*/
 			*/
 							max_used     >= 2 * min_used {
 							max_used     >= 2 * min_used {
 			// err = s_mp_mul_balance(a,b,c);
 			// err = s_mp_mul_balance(a,b,c);
-		} else if false && min_used >= MUL_TOOM_CUTOFF {
+		} else if min_used >= MUL_TOOM_CUTOFF {
 			/*
 			/*
 				Toom path commented out until it no longer fails Factorial 10k or 100k,
 				Toom path commented out until it no longer fails Factorial 10k or 100k,
 				as reveaved in the long test.
 				as reveaved in the long test.
@@ -694,7 +696,7 @@ internal_int_mul :: proc(dest, src, multiplier: ^Int, allocator := context.alloc
 			err = #force_inline _private_int_mul(dest, src, multiplier, digits);
 			err = #force_inline _private_int_mul(dest, src, multiplier, digits);
 		}
 		}
 	}
 	}
-	neg := src.sign != multiplier.sign;
+
 	dest.sign = .Negative if dest.used > 0 && neg else .Zero_or_Positive;
 	dest.sign = .Negative if dest.used > 0 && neg else .Zero_or_Positive;
 	return err;
 	return err;
 }
 }

+ 1 - 0
core/math/big/private.odin

@@ -161,6 +161,7 @@ _private_int_mul_toom :: proc(dest, a, b: ^Int, allocator := context.allocator)
 	internal_clamp(b1);
 	internal_clamp(b1);
 	internal_clamp(b2);
 	internal_clamp(b2);
 
 
+
 	/*
 	/*
 		\\ S1 = (a2+a1+a0) * (b2+b1+b0);
 		\\ S1 = (a2+a1+a0) * (b2+b1+b0);
 	*/
 	*/

部分文件因为文件数量过多而无法显示