citra-emu
/
citra-canary
Archived
1
0
Fork 0
This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
citra-canary/src
Mat M 85d37c9994
gl_shader_disk: Make use of std::nullopt where applicable (#5293)
Some implementations can use the std::nullopt_t constructor of
std::optional to avoid needing to completely zero out the internal
buffer of the optional and instead only set the validity byte within it.

e.g. Consider the following function:

std::optional<std::vector<ShaderDiskCacheRaw>> fn() {
    return {};
}

With libc++ this will result in the following code generation on x86-64:

Fn():
  mov     rax, rdi
  vxorps  xmm0, xmm0, xmm0
  vmovups ymmword ptr [rdi], ymm0
  vzeroupper
  ret

With libstdc++, we also get the similar equivalent:

Fn():
  vpxor   xmm0, xmm0, xmm0
  mov     rax, rdi
  vmovdqu XMMWORD PTR [rdi], xmm0
  vmovdqu XMMWORD PTR [rdi+16], xmm0
  ret

If we change this function to return std::nullopt instead, then this
simplifies both the code gen from libc++ and libstdc++ down to:

Fn():
  mov     BYTE PTR [rdi+24], 0
  mov     rax, rdi
  ret

Given how little of a change is necessary to result in better code
generation, this is essentially a "free" very minor optimization.
2020-04-30 22:42:32 -05:00
..
android android: add logging 2019-03-09 18:23:32 -06:00
audio_core Add sample rate field to AAC decoder (#5195) 2020-04-21 20:34:50 -05:00
citra Merge pull request #5083 from zhaowenlan1779/video-dumping-update 2020-04-03 21:15:32 -05:00
citra_qt Merge pull request #4908 from hamish-milne/feature/savestates-2 2020-04-17 21:52:51 +02:00
common Merge pull request #4908 from hamish-milne/feature/savestates-2 2020-04-17 21:52:51 +02:00
core savedata_archive: Make GetFreeBytes return a more accurate value 2020-04-29 05:42:40 +02:00
dedicated_room Fix moderation by room host in dedicated rooms 2019-11-17 09:59:54 -05:00
input_common Merge pull request #5179 from vitor-k/reenable-hidapi 2020-04-27 16:35:51 +02:00
network Merge branch 'master' into feature/savestates-2 2020-04-16 19:03:49 +01:00
tests clang format fixes etc. 2020-03-31 18:27:33 +01:00
video_core gl_shader_disk: Make use of std::nullopt where applicable (#5293) 2020-04-30 22:42:32 -05:00
web_service HTTP_C::Implement Context::MakeRequest (#4754) 2020-02-21 19:04:04 +01:00
.clang-format add java to .clang-format 2019-02-22 16:29:19 -06:00
CMakeLists.txt Code review actions (plus hopefully fix the linux CI) 2020-03-31 17:54:28 +01:00