From 6c07eb8e5cb20a6e8d4f574c439d31dece3eb084 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 5 Sep 2015 14:37:55 -0700 Subject: [PATCH] Faster RtlFillMemoryUlong. --- src/xenia/kernel/util/shim_utils.h | 1 + src/xenia/kernel/xboxkrnl_rtl.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/util/shim_utils.h b/src/xenia/kernel/util/shim_utils.h index f5bb5c5ae..652801b8a 100644 --- a/src/xenia/kernel/util/shim_utils.h +++ b/src/xenia/kernel/util/shim_utils.h @@ -146,6 +146,7 @@ class ParamBase : public Param { return *this; } operator T() const { return value_; } + T value() const { return value_; } protected: T value_; diff --git a/src/xenia/kernel/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl_rtl.cc index bb06867c3..651211563 100644 --- a/src/xenia/kernel/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl_rtl.cc @@ -77,8 +77,9 @@ void RtlFillMemoryUlong(lpvoid_t destination, dword_t length, dword_t pattern) { uint32_t count = length >> 2; uint32_t* p = destination.as(); + uint32_t swapped_pattern = xe::byte_swap(pattern.value()); for (uint32_t n = 0; n < count; n++, p++) { - *p = xe::byte_swap((uint32_t)pattern); + *p = swapped_pattern; } } DECLARE_XBOXKRNL_EXPORT(RtlFillMemoryUlong, ExportTag::kImplemented);