From 9e80db123f4f8b6b51c672bec729a70a21ee7af4 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 6 Jul 2021 16:53:04 +0200 Subject: JitArm64: Encode logical immediates at compile-time where possible Manually encoding and decoding logical immediates is error-prone. Using ORRI2R and friends lets us avoid doing the work manually, but in exchange, there is a runtime performance penalty. It's probably rather small, but still, it would be nice if we could let the compiler do the work at compile-time. And that's exactly what this commit does, so now I have no excuse for trying to manually write logical immediates anymore. --- Source/Core/VideoCommon/VertexLoaderARM64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoaderARM64.cpp') diff --git a/Source/Core/VideoCommon/VertexLoaderARM64.cpp b/Source/Core/VideoCommon/VertexLoaderARM64.cpp index eb16ec9bd3..dc760b011b 100644 --- a/Source/Core/VideoCommon/VertexLoaderARM64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderARM64.cpp @@ -244,7 +244,7 @@ void VertexLoaderARM64::ReadColor(VertexComponentFormat attribute, ColorFormat f LDR(IndexType::Unsigned, scratch2_reg, src_reg, offset); if (format != ColorFormat::RGBA8888) - ORRI2R(scratch2_reg, scratch2_reg, 0xFF000000); + ORR(scratch2_reg, scratch2_reg, LogicalImm(0xFF000000, 32)); STR(IndexType::Unsigned, scratch2_reg, dst_reg, m_dst_ofs); load_bytes = format == ColorFormat::RGB888 ? 3 : 4; break; @@ -279,7 +279,7 @@ void VertexLoaderARM64::ReadColor(VertexComponentFormat attribute, ColorFormat f ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 2)); // A - ORRI2R(scratch1_reg, scratch1_reg, 0xFF000000); + ORR(scratch1_reg, scratch1_reg, LogicalImm(0xFF000000, 32)); STR(IndexType::Unsigned, scratch1_reg, dst_reg, m_dst_ofs); load_bytes = 2; -- cgit v1.2.3