aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode/xmad.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-07-24 06:33:09 -0700
committerGitHub <noreply@github.com>2020-07-24 06:33:09 -0700
commitf650cf8a9a4f4976356e7e2eef404e81ccc0c8aa (patch)
treeacb35a74ffe2349a7ac0c605a4c43972142bfdb2 /src/video_core/shader/decode/xmad.cpp
parent1d7de0a8ee04713c5d8011f379524ff53cb8c483 (diff)
parent6adc824d9d15b476320739788564023f995b9da0 (diff)
Merge pull request #4391 from lioncash/nrvo
video_core: Allow copy elision to take place where applicable
Diffstat (limited to 'src/video_core/shader/decode/xmad.cpp')
-rw-r--r--src/video_core/shader/decode/xmad.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/video_core/shader/decode/xmad.cpp b/src/video_core/shader/decode/xmad.cpp
index c83dc6615..233b8fa42 100644
--- a/src/video_core/shader/decode/xmad.cpp
+++ b/src/video_core/shader/decode/xmad.cpp
@@ -81,20 +81,21 @@ u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
SetTemporary(bb, 0, product);
product = GetTemporary(0);
- const Node original_c = op_c;
+ Node original_c = op_c;
const Tegra::Shader::XmadMode set_mode = mode; // Workaround to clang compile error
- op_c = [&]() {
+ op_c = [&] {
switch (set_mode) {
case Tegra::Shader::XmadMode::None:
return original_c;
case Tegra::Shader::XmadMode::CLo:
- return BitfieldExtract(original_c, 0, 16);
+ return BitfieldExtract(std::move(original_c), 0, 16);
case Tegra::Shader::XmadMode::CHi:
- return BitfieldExtract(original_c, 16, 16);
+ return BitfieldExtract(std::move(original_c), 16, 16);
case Tegra::Shader::XmadMode::CBcc: {
- const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b,
- original_b, Immediate(16));
- return SignedOperation(OperationCode::IAdd, is_signed_c, original_c, shifted_b);
+ Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b,
+ original_b, Immediate(16));
+ return SignedOperation(OperationCode::IAdd, is_signed_c, std::move(original_c),
+ std::move(shifted_b));
}
case Tegra::Shader::XmadMode::CSfu: {
const Node comp_a =