mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-25 09:41:22 -08:00
shader/arithmetic_integer: Implement IADD.X
IADD.X takes the carry flag and adds it to the result. This is generally used to emulate 64-bit operations with 32-bit registers.
This commit is contained in:
parent
255197e643
commit
c788f9c0bd
@ -813,6 +813,10 @@ union Instruction {
|
|||||||
BitField<49, 1, u64> negate_a;
|
BitField<49, 1, u64> negate_a;
|
||||||
} alu_integer;
|
} alu_integer;
|
||||||
|
|
||||||
|
union {
|
||||||
|
BitField<43, 1, u64> x;
|
||||||
|
} iadd;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
BitField<39, 1, u64> ftz;
|
BitField<39, 1, u64> ftz;
|
||||||
BitField<32, 1, u64> saturate;
|
BitField<32, 1, u64> saturate;
|
||||||
|
@ -42,6 +42,12 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
|
|||||||
|
|
||||||
Node value = Operation(OperationCode::IAdd, op_a, op_b);
|
Node value = Operation(OperationCode::IAdd, op_a, op_b);
|
||||||
|
|
||||||
|
if (instr.iadd.x) {
|
||||||
|
Node carry = GetInternalFlag(InternalFlag::Carry);
|
||||||
|
Node x = Operation(OperationCode::Select, std::move(carry), Immediate(1), Immediate(0));
|
||||||
|
value = Operation(OperationCode::IAdd, std::move(value), std::move(x));
|
||||||
|
}
|
||||||
|
|
||||||
if (instr.generates_cc) {
|
if (instr.generates_cc) {
|
||||||
const Node i0 = Immediate(0);
|
const Node i0 = Immediate(0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user