Skip to content

Commit

Permalink
Workaround clang/LLVM bug with /fp:fast+SSE+float_control (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Feb 5, 2024
1 parent 4e529da commit e2ac091
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions UVAtlas/geodesics/ApproximateOneToAll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ void CApproximateOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
tmpdif = fabs(sigma + SqrtMin0(SquredD2Dist(spie, tmpp)) - tmpDp);
}
break;

default:
break;
}

if (tmpdif > diflargest)
Expand Down
6 changes: 6 additions & 0 deletions UVAtlas/isochart/UVAtlasRepacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e2ac091

Please sign in to comment.