Workaround clang/LLVM bug with /fp:fast+SSE+float_control (#142)

This commit is contained in:
Chuck Walbourn 2024-02-05 10:09:18 -08:00 committed by GitHub
parent 4e529da621
commit e2ac0915bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View File

@ -308,7 +308,7 @@ endif()
if(MSVC)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /Wall /GR- /fp:fast "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
target_compile_options(${t} PRIVATE /Wall /GR- "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
target_link_options(${t} PRIVATE /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO)
endforeach()
@ -388,7 +388,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endforeach()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline)
target_compile_options(${t} PRIVATE /sdl /permissive- /JMC- /Zc:__cplusplus /Zc:inline /fp:fast)
endforeach()
if(ENABLE_CODE_ANALYSIS)

View File

@ -276,6 +276,9 @@ void CApproximateOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
tmpdif = fabs(sigma + SqrtMin0(SquredD2Dist(spie, tmpp)) - tmpDp);
}
break;
default:
break;
}
if (tmpdif > diflargest)

View File

@ -1560,6 +1560,8 @@ void CUVAtlasRepacker::GetChartPutPosition(uint32_t index)
else
m_chartFromX = m_fromX + m_triedOverlappedLen - pPosInfo->numY;
break;
default:
break;
}
if (m_triedPutRotation == 0 || m_triedPutRotation == 180) {
@ -1638,6 +1640,8 @@ void CUVAtlasRepacker::PutChartInPosition(uint32_t index)
m_PixelWidth * float(m_chartFromX) - pPosInfo->basePoint.x,
m_PixelWidth * float(m_chartToY) - pPosInfo->basePoint.y, 0.0f);
break;
default:
break;
}
XMStoreFloat4x4(&m_ResultMatrix[index], matrixRotate * transMatrix);
@ -1755,6 +1759,8 @@ void CUVAtlasRepacker::UpdateSpaceInfo(int direction)
m_SpaceInfo[UV_DOWNSIDE][size_t(i)] = maxY - j - 1;
}
break;
default:
break;
}
m_fromX = minX;