Skip to content

Commit 815a70c

Browse files
committed
Colorspace Handler: Fix a compiling issue for AVX-512. (Regression from commit 586aea5.)
1 parent 335c7ad commit 815a70c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

desmume/src/utils/colorspacehandler/colorspacehandler_AVX512.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2016-2024 DeSmuME team
2+
Copyright (C) 2016-2025 DeSmuME team
33
44
This file is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -115,14 +115,16 @@ FORCEINLINE void ColorspaceConvert555xTo6665Opaque_AVX512(const v512u16 &srcColo
115115
template <bool SWAP_RB>
116116
FORCEINLINE void ColorspaceConvert5551To8888_AVX512(const v512u16 &srcColor, v512u32 &dstLo, v512u32 &dstHi)
117117
{
118-
const v512u16 srcAlphaBits16 = _mm512_and_si512( _mm512_cmpgt_epi16(_mm512_setzero_si512(), srcColor), _mm512_set1_epi16(0xFF00) );
118+
const __mmask32 result = _mm512_cmpgt_epi16_mask(_mm512_setzero_si512(), srcColor);
119+
const v512u16 srcAlphaBits16 = _mm512_mask_blend_epi16( result, _mm512_setzero_si512(), _mm512_set1_epi16(0xFF00) );
119120
ColorspaceConvert555aTo8888_AVX512<SWAP_RB>(srcColor, srcAlphaBits16, dstLo, dstHi);
120121
}
121122

122123
template <bool SWAP_RB>
123124
FORCEINLINE void ColorspaceConvert5551To6665_AVX512(const v512u16 &srcColor, v512u32 &dstLo, v512u32 &dstHi)
124125
{
125-
const v512u16 srcAlphaBits16 = _mm512_and_si512( _mm512_cmpgt_epi16(_mm512_setzero_si512(), srcColor), _mm512_set1_epi16(0x1F00) );
126+
const __mmask32 result = _mm512_cmpgt_epi16_mask(_mm512_setzero_si512(), srcColor);
127+
const v512u16 srcAlphaBits16 = _mm512_mask_blend_epi16( result, _mm512_setzero_si512(), _mm512_set1_epi16(0x1F00) );
126128
ColorspaceConvert555aTo6665_AVX512<SWAP_RB>(srcColor, srcAlphaBits16, dstLo, dstHi);
127129
}
128130

0 commit comments

Comments
 (0)