From f5a9f2e413de15c81a4192f9fd90f54fad20457b Mon Sep 17 00:00:00 2001 From: dreamstalker Date: Wed, 17 Jun 2015 23:36:36 +0400 Subject: [PATCH] Workaround for 'stack misaligned when inlining SSE' bug in icc --- rehlds/engine/common.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rehlds/engine/common.cpp b/rehlds/engine/common.cpp index 368cece..a73df82 100644 --- a/rehlds/engine/common.cpp +++ b/rehlds/engine/common.cpp @@ -523,7 +523,7 @@ void MSG_WBits_MaybeFlush() { bfwrite.nCurOutputBit -= 32; } -void MSG_WriteBits(uint32 data, int numbits) +void NOINLINE MSG_WriteBits(uint32 data, int numbits) { uint32 maxval = _mm_cvtsi128_si32(_mm_slli_epi64(_mm_cvtsi32_si128(1), numbits)) - 1; //maxval = (1 << numbits) - 1 if (data > maxval) @@ -544,14 +544,14 @@ void MSG_WriteOneBit(int nValue) { MSG_WriteBits(nValue, 1); } -void MSG_StartBitWriting(sizebuf_t *buf) +void NOINLINE MSG_StartBitWriting(sizebuf_t *buf) { bfwrite.nCurOutputBit = 0; bfwrite.pbuf = buf; bfwrite.pendingData.u64 = 0; } -void MSG_EndBitWriting(sizebuf_t *buf) +void NOINLINE MSG_EndBitWriting(sizebuf_t *buf) { int bytesNeed = bfwrite.nCurOutputBit / 8; if ((bfwrite.nCurOutputBit % 8) || bytesNeed == 0) {