2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Workaround for 'stack misaligned when inlining SSE' bug in icc

This commit is contained in:
dreamstalker 2015-06-17 23:36:36 +04:00
parent da547bd7c7
commit f5a9f2e413

View File

@ -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) {