From 389de8b107e8e40dad754f036b6e2adc5b5a0936 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 23 Aug 2014 09:55:49 -0700 Subject: [PATCH] Subtract should subtract. Thanks hlide! --- src/alloy/backend/x64/x64_sequences.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alloy/backend/x64/x64_sequences.cc b/src/alloy/backend/x64/x64_sequences.cc index d316af9c5..a6fbd75af 100644 --- a/src/alloy/backend/x64/x64_sequences.cc +++ b/src/alloy/backend/x64/x64_sequences.cc @@ -2878,7 +2878,7 @@ EMITTER(VECTOR_SUB, MATCH(I, V128<>, V128<>>)) { _mm_store_si128(reinterpret_cast<__m128i*>(&src1v), src1); _mm_store_si128(reinterpret_cast<__m128i*>(&src2v), src2); for (size_t i = 0; i < 4; ++i) { - auto t = int64_t(src1v[i]) + int64_t(src2v[i]); + auto t = int64_t(src1v[i]) - int64_t(src2v[i]); value[i] = t < INT_MIN ? INT_MIN : (t > INT_MAX ? INT_MAX : int32_t(t)); } return _mm_load_si128(reinterpret_cast<__m128i*>(&value));