diff --git a/rpcs3/Emu/CPU/CPUTranslator.h b/rpcs3/Emu/CPU/CPUTranslator.h index a6290ccc6e..64e348bbf5 100644 --- a/rpcs3/Emu/CPU/CPUTranslator.h +++ b/rpcs3/Emu/CPU/CPUTranslator.h @@ -711,6 +711,38 @@ public: return result; } + template + value_t bitcast(T2 expr) + { + value_t result; + result.value = m_ir->CreateBitCast(expr.eval(m_ir), result.get_type(m_context)); + return result; + } + + template + value_t trunc(T2 expr) + { + value_t result; + result.value = m_ir->CreateTrunc(expr.eval(m_ir), result.get_type(m_context)); + return result; + } + + template + value_t sext(T2 expr) + { + value_t result; + result.value = m_ir->CreateSExt(expr.eval(m_ir), result.get_type(m_context)); + return result; + } + + template + value_t zext(T2 expr) + { + value_t result; + result.value = m_ir->CreateZExt(expr.eval(m_ir), result.get_type(m_context)); + return result; + } + // Get unsigned addition carry into the sign bit (s = a + b) template static inline auto ucarry(T a, T b, T s)