diff options
| author | 2021-03-05 01:15:16 -0500 | |
|---|---|---|
| committer | 2021-07-22 21:51:23 -0400 | |
| commit | 5465cb156107a27df525dfedbfd4e920b7f71253 (patch) | |
| tree | 3bc5940f90e31e09820af69cd845eef92a7d7201 /src/shader_recompiler/backend | |
| parent | shader: Deduplicate HADD2 code (diff) | |
| download | yuzu-5465cb156107a27df525dfedbfd4e920b7f71253.tar.gz yuzu-5465cb156107a27df525dfedbfd4e920b7f71253.tar.xz yuzu-5465cb156107a27df525dfedbfd4e920b7f71253.zip | |
shader: Implement LEA
Diffstat (limited to 'src/shader_recompiler/backend')
3 files changed, 13 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index bed43c094..1f7d84871 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h | |||
| @@ -132,7 +132,7 @@ void EmitBitCastU64F64(EmitContext& ctx); | |||
| 132 | void EmitBitCastF16U16(EmitContext& ctx); | 132 | void EmitBitCastF16U16(EmitContext& ctx); |
| 133 | Id EmitBitCastF32U32(EmitContext& ctx, Id value); | 133 | Id EmitBitCastF32U32(EmitContext& ctx, Id value); |
| 134 | void EmitBitCastF64U64(EmitContext& ctx); | 134 | void EmitBitCastF64U64(EmitContext& ctx); |
| 135 | void EmitPackUint2x32(EmitContext& ctx); | 135 | Id EmitPackUint2x32(EmitContext& ctx, Id value); |
| 136 | Id EmitUnpackUint2x32(EmitContext& ctx, Id value); | 136 | Id EmitUnpackUint2x32(EmitContext& ctx, Id value); |
| 137 | Id EmitPackFloat2x16(EmitContext& ctx, Id value); | 137 | Id EmitPackFloat2x16(EmitContext& ctx, Id value); |
| 138 | Id EmitUnpackFloat2x16(EmitContext& ctx, Id value); | 138 | Id EmitUnpackFloat2x16(EmitContext& ctx, Id value); |
| @@ -229,9 +229,11 @@ Id EmitISub32(EmitContext& ctx, Id a, Id b); | |||
| 229 | void EmitISub64(EmitContext& ctx); | 229 | void EmitISub64(EmitContext& ctx); |
| 230 | Id EmitIMul32(EmitContext& ctx, Id a, Id b); | 230 | Id EmitIMul32(EmitContext& ctx, Id a, Id b); |
| 231 | Id EmitINeg32(EmitContext& ctx, Id value); | 231 | Id EmitINeg32(EmitContext& ctx, Id value); |
| 232 | Id EmitINeg64(EmitContext& ctx, Id value); | ||
| 232 | Id EmitIAbs32(EmitContext& ctx, Id value); | 233 | Id EmitIAbs32(EmitContext& ctx, Id value); |
| 233 | Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift); | 234 | Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift); |
| 234 | Id EmitShiftRightLogical32(EmitContext& ctx, Id a, Id b); | 235 | Id EmitShiftRightLogical32(EmitContext& ctx, Id a, Id b); |
| 236 | Id EmitShiftRightLogical64(EmitContext& ctx, Id a, Id b); | ||
| 235 | Id EmitShiftRightArithmetic32(EmitContext& ctx, Id a, Id b); | 237 | Id EmitShiftRightArithmetic32(EmitContext& ctx, Id a, Id b); |
| 236 | Id EmitBitwiseAnd32(EmitContext& ctx, Id a, Id b); | 238 | Id EmitBitwiseAnd32(EmitContext& ctx, Id a, Id b); |
| 237 | Id EmitBitwiseOr32(EmitContext& ctx, Id a, Id b); | 239 | Id EmitBitwiseOr32(EmitContext& ctx, Id a, Id b); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp index e0d1ba413..93a45d834 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp | |||
| @@ -30,8 +30,8 @@ void EmitBitCastF64U64(EmitContext&) { | |||
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void EmitPackUint2x32(EmitContext&) { | 33 | Id EmitPackUint2x32(EmitContext& ctx, Id value) { |
| 34 | throw NotImplementedException("SPIR-V Instruction"); | 34 | return ctx.OpBitcast(ctx.U64, value); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | Id EmitUnpackUint2x32(EmitContext& ctx, Id value) { | 37 | Id EmitUnpackUint2x32(EmitContext& ctx, Id value) { |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp index 162fb6a91..f5001cdaa 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp | |||
| @@ -62,6 +62,10 @@ Id EmitINeg32(EmitContext& ctx, Id value) { | |||
| 62 | return ctx.OpSNegate(ctx.U32[1], value); | 62 | return ctx.OpSNegate(ctx.U32[1], value); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | Id EmitINeg64(EmitContext& ctx, Id value) { | ||
| 66 | return ctx.OpSNegate(ctx.U64, value); | ||
| 67 | } | ||
| 68 | |||
| 65 | Id EmitIAbs32(EmitContext& ctx, Id value) { | 69 | Id EmitIAbs32(EmitContext& ctx, Id value) { |
| 66 | return ctx.OpSAbs(ctx.U32[1], value); | 70 | return ctx.OpSAbs(ctx.U32[1], value); |
| 67 | } | 71 | } |
| @@ -74,6 +78,10 @@ Id EmitShiftRightLogical32(EmitContext& ctx, Id a, Id b) { | |||
| 74 | return ctx.OpShiftRightLogical(ctx.U32[1], a, b); | 78 | return ctx.OpShiftRightLogical(ctx.U32[1], a, b); |
| 75 | } | 79 | } |
| 76 | 80 | ||
| 81 | Id EmitShiftRightLogical64(EmitContext& ctx, Id a, Id b) { | ||
| 82 | return ctx.OpShiftRightLogical(ctx.U64, a, b); | ||
| 83 | } | ||
| 84 | |||
| 77 | Id EmitShiftRightArithmetic32(EmitContext& ctx, Id a, Id b) { | 85 | Id EmitShiftRightArithmetic32(EmitContext& ctx, Id a, Id b) { |
| 78 | return ctx.OpShiftRightArithmetic(ctx.U32[1], a, b); | 86 | return ctx.OpShiftRightArithmetic(ctx.U32[1], a, b); |
| 79 | } | 87 | } |