176b7f04d308 — Vesa Norilo 2 years ago
Fix bad constant propagation for BitShiftLeft for Int32
2 files changed, 7 insertions(+), 6 deletions(-)

M .hgsubstate
M src/k3/Native.cpp
M .hgsubstate +1 -1
@@ 1,4 1,4 @@ 
-accd03c99f036645d3f5989c8deefb01e52c59a9 library
+d78bdb313972503e928a1809784fca3639a18296 library
 8b4b21f3c6f21d1e6eb60d7b0debfb74597ca2f5 src/lithe
 d88ce622aaf77f683bb589f1089ea1ba51423818 src/pad
 29a29937ee1095e5ddf1655902f1ed09c810bbf3 src/paf

          
M src/k3/Native.cpp +6 -5
@@ 486,9 486,10 @@ namespace K3 {
 				GENERIC_NODE_INLINE(GBin, IGenericBinary)
 					PUBLIC
 					static GBin* New(CGRef a, CGRef b) { return new GBin(a, b); }
-				GBin(CGRef a, CGRef b) :IGenericBinary(a, b) {}
-				const char *PrettyName() const override { return Mnemonic[GetOpcode()]; }
-				Opcode GetOpcode() const override { return (Opcode)OPCODE; }
+					GBin(CGRef a, CGRef b) :IGenericBinary(a, b) {}
+					const char *PrettyName() const override { return Mnemonic[GetOpcode()]; }
+					Opcode GetOpcode() const override { return (Opcode)OPCODE; }
+
 				Specialization Specialize(SpecializationState& spec) const override {
 					SPECIALIZE(spec, a, GetUp(0));
 					SPECIALIZE(spec, b, GetUp(1));

          
@@ 551,7 552,7 @@ namespace K3 {
 				}
 				END
 
-					return GBin::New(a, b);
+				return GBin::New(a, b);
 			}
 
 			template <int OPCODE> CGRef Make(

          
@@ 963,7 964,7 @@ namespace K3 {
 
 		pack.AddFunction("BitShiftRight", Make<BitShiftRight>("BitShiftRight", nullptr, nullptr, [](int32_t a, int32_t b) {return a >> b; }, [](int64_t a, int64_t b) {return a >> b; }, nullptr, b1, b2), "a b", "Shifts the integer value 'a' right by 'b' bits");
 		pack.AddFunction("LogicalShiftRight", Make<LogicalShiftRight>("LogicalShiftRight", nullptr, nullptr, [](int32_t a, int32_t b) { return (int32_t)((uint32_t)a >> b); }, [](int64_t a, int64_t b) { return (int64_t)((uint64_t)a >> b); }, nullptr, b1, b2), "a b", "Shifts the integer value 'a' right by 'b' bits including the sign bit.");
-		pack.AddFunction("BitShiftLeft", Make<BitShiftLeft>("BitShiftLeft", nullptr, nullptr, [](int32_t a, int32_t b) {return a >> b; }, [](int64_t a, int64_t b) {return a << b; }, nullptr, b1, b2), "a b", "Shifts the integer value 'a' left by 'b' bits");
+		pack.AddFunction("BitShiftLeft", Make<BitShiftLeft>("BitShiftLeft", nullptr, nullptr, [](int32_t a, int32_t b) {return a << b; }, [](int64_t a, int64_t b) {return a << b; }, nullptr, b1, b2), "a b", "Shifts the integer value 'a' left by 'b' bits");
 
 		Make<Native::Abs>("abs", _ABS<float>, _ABS<double>, _ABS<std::int32_t>, _ABS<std::int64_t>, _ABS<BigNum>, arg);