1. 14 Apr, 2019 8 commits
  2. 13 Apr, 2019 2 commits
  3. 12 Apr, 2019 10 commits
    • FreddyFunk's avatar
      Fix Clang Format · 382722b9
      FreddyFunk authored
      382722b9
    • Lioncash's avatar
      common/swap: Improve codegen of the default swap fallbacks · 0d8ef2d3
      Lioncash authored
      Uses arithmetic that can be identified more trivially by compilers for
      optimizations. e.g. Rather than shifting the halves of the value and
      then swapping and combining them, we can swap them in place.
      
      e.g. for the original swap32 code on x86-64, clang 8.0 would generate:
      
          mov     ecx, edi
          rol     cx, 8
          shl     ecx, 16
          shr     edi, 16
          rol     di, 8
          movzx   eax, di
          or      eax, ecx
          ret
      
      while GCC 8.3 would generate the ideal:
      
          mov     eax, edi
          bswap   eax
          ret
      
      now both generate the same optimal output.
      
      MSVC used to generate the following with the old code:
      
          mov     eax, ecx
          rol     cx, 8
          shr     eax, 16
          rol     ax, 8
          movzx   ecx, cx
          movzx   eax, ax
          shl     ecx, 16
          or      eax, ecx
          ret     0
      
      Now MSVC also generates a similar, but equally optimal result as clang/GCC:
      
          bswap   ecx
          mov     eax, ecx
          ret     0
      
      ====
      
      In the swap64 case, for the original code, clang 8.0 would generate:
      
          mov     eax, edi
          bswap   eax
          shl     rax, 32
          shr     rdi, 32
          bswap   edi
          or      rax, rdi
          ret
      
      (almost there, but still missing the mark)
      
      while, again, GCC 8.3 would generate the more ideal:
      
          mov     rax, rdi
          bswap   rax
          ret
      
      now clang also generates the optimal sequence for this fallback as well.
      
      This is a case where MSVC unfortunately falls short, despite the new
      code, this one still generates a doozy of an output.
      
          mov     r8, rcx
          mov     r9, rcx
          mov     rax, 71776119061217280
          mov     rdx, r8
          and     r9, rax
          and     edx, 65280
          mov     rax, rcx
          shr     rax, 16
          or      r9, rax
          mov     rax, rcx
          shr     r9, 16
          mov     rcx, 280375465082880
          and     rax, rcx
          mov     rcx, 1095216660480
          or      r9, rax
          mov     rax, r8
          and     rax, rcx
          shr     r9, 16
          or      r9, rax
          mov     rcx, r8
          mov     rax, r8
          shr     r9, 8
          shl     rax, 16
          and     ecx, 16711680
          or      rdx, rax
          mov     eax, -16777216
          and     rax, r8
          shl     rdx, 16
          or      rdx, rcx
          shl     rdx, 16
          or      rax, rdx
          shl     rax, 8
          or      rax, r9
          ret     0
      
      which is pretty unfortunate.
      0d8ef2d3
    • bunnei's avatar
      Merge pull request #2235 from ReinUsesLisp/spirv-decompiler · ea80e2bc
      bunnei authored
      vk_shader_decompiler: Implement a SPIR-V decompiler
      ea80e2bc
    • bunnei's avatar
      Merge pull request #2360 from lioncash/svc-global · 83a2fb3c
      bunnei authored
      kernel/svc: Deglobalize the supervisor call handlers
      83a2fb3c
    • bunnei's avatar
      Merge pull request #2388 from lioncash/constexpr · e2f2155d
      bunnei authored
      kernel: Make handle type declarations constexpr
      e2f2155d
    • bunnei's avatar
      Merge pull request #2387 from FernandoS27/fast-copy-relax · c0b2b702
      bunnei authored
      gl_rasterizer_cache: Relax restrictions on FastCopySurface
      c0b2b702
    • Lioncash's avatar
      common/swap: Mark byte swapping free functions with [[nodiscard]] and noexcept · 66b73fd3
      Lioncash authored
      Allows the compiler to inform when the result of a swap function is
      being ignored (which is 100% a bug in all usage scenarios). We also mark
      them noexcept to allow other functions using them to be able to be
      marked as noexcept and play nicely with things that potentially inspect
      "nothrowability".
      66b73fd3
    • Lioncash's avatar
      common/swap: Simplify swap function ifdefs · 9cb4b7be
      Lioncash authored
      Including every OS' own built-in byte swapping functions is kind of
      undesirable, since it adds yet another build path to ensure compilation
      succeeds on.
      
      Given we only support clang, GCC, and MSVC for the time being, we can
      utilize their built-in functions directly instead of going through the
      OS's API functions.
      
      This shrinks the overall code down to just
      
      if (msvc)
        use msvc's functions
      else if (clang or gcc)
        use clang/gcc's builtins
      else
        use the slow path
      9cb4b7be
    • Lioncash's avatar
      common/swap: Remove 32-bit ARM path · 59895443
      Lioncash authored
      We don't plan to support host 32-bit ARM execution environments, so this
      is essentially dead code.
      59895443
    • Lioncash's avatar
      common/scope_exit: Replace std::move with std::forward in ScopeExit() · b5696410
      Lioncash authored
      The template type here is actually a forwarding reference, not an rvalue
      reference in this case, so it's more appropriate to use std::forward to
      preserve the value category of the type being moved.
      b5696410
  4. 11 Apr, 2019 5 commits
  5. 10 Apr, 2019 15 commits