summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VideoBackendBase.cpp
diff options
context:
space:
mode:
authorLioncash <mai.iam2048@gmail.com>2023-06-08 14:20:36 -0400
committerLioncash <mai.iam2048@gmail.com>2023-06-08 14:33:13 -0400
commit09271f365a68ba1e214e52d5367f78a4b0e2c17d (patch)
treec2a605ba4c8ca93dd58defb06003f789de0920bc /Source/Core/VideoCommon/VideoBackendBase.cpp
parent78f5c5f8d23f8dc8e5650d776b5883252a31385d (diff)
PowerPC/ConditionRegister: Mark PPCToInternal() as constexpr
This allows the compiler to eliminate a static constructor that initializes the table, and instead precompute all of the data ahead of time. e.g. We get something like so on GCC without constexpr: _GLOBAL__sub_I_PowerPC::ConditionRegister::s_crTable: movdqa xmm0, XMMWORD PTR .LC0[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip], xmm0 movdqa xmm0, XMMWORD PTR .LC1[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+16], xmm0 movdqa xmm0, XMMWORD PTR .LC2[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+32], xmm0 movdqa xmm0, XMMWORD PTR .LC3[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+48], xmm0 movdqa xmm0, XMMWORD PTR .LC4[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+64], xmm0 movdqa xmm0, XMMWORD PTR .LC5[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+80], xmm0 movdqa xmm0, XMMWORD PTR .LC6[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+96], xmm0 movdqa xmm0, XMMWORD PTR .LC7[rip] movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+112], xmm0 ret PowerPC::ConditionRegister::s_crTable: .zero 128 .LC0: .quad -9223372032559808511 .quad -8646911280256385023 .LC1: .quad -9223372032559808512 .quad -8646911280256385024 .LC2: .quad 4294967297 .quad 576460756598390785 .LC3: .quad 4294967296 .quad 576460756598390784 .LC4: .quad -4611686014132420607 .quad -4035225261828997119 .LC5: .quad -4611686014132420608 .quad -4035225261828997120 .LC6: .quad 4611686022722355201 .quad 5188146775025778689 .LC7: .quad 4611686022722355200 .quad 5188146775025778688 and with constexpr, this all get collapsed into: PowerPC::ConditionRegister::s_crTable: .quad -9223372032559808511 .quad -8646911280256385023 .quad -9223372032559808512 .quad -8646911280256385024 .quad 4294967297 .quad 576460756598390785 .quad 4294967296 .quad 576460756598390784 .quad -4611686014132420607 .quad -4035225261828997119 .quad -4611686014132420608 .quad -4035225261828997120 .quad 4611686022722355201 .quad 5188146775025778689 .quad 4611686022722355200 .quad 5188146775025778688 completely eliminating the static constructor. MSVC also exhibits this, whereas clang is a little better and does this anyway, even without constexpr.
Diffstat (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp')
0 files changed, 0 insertions, 0 deletions