Improve documentation of unsafe optimizations

This commit is contained in:
MerryMage
2020-07-12 12:38:22 +01:00
parent 82417da780
commit d05d95c132
8 changed files with 69 additions and 17 deletions

View File

@@ -14,6 +14,8 @@
#include <mp/typelist/list.h>
#include <mp/typelist/lower_to_tuple.h>
#include <dynarmic/optimization_flags.h>
#include "backend/x64/abi.h"
#include "backend/x64/block_of_code.h"
#include "backend/x64/emit_x64.h"
@@ -638,7 +640,7 @@ static void EmitFPMulAdd(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) {
return;
}
if (ctx.UnsafeOptimizations()) {
if (ctx.HasOptimization(OptimizationFlag::Unsafe_UnfuseFMA)) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
const Xbyak::Xmm operand1 = ctx.reg_alloc.UseScratchXmm(args[0]);
@@ -743,7 +745,7 @@ static void EmitFPRecipEstimate(BlockOfCode& code, EmitContext& ctx, IR::Inst* i
using FPT = mp::unsigned_integer_of_size<fsize>;
if constexpr (fsize != 16) {
if (ctx.UnsafeOptimizations()) {
if (ctx.HasOptimization(OptimizationFlag::Unsafe_ReducedErrorFP)) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
const Xbyak::Xmm operand = ctx.reg_alloc.UseXmm(args[0]);
const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm();
@@ -939,7 +941,7 @@ static void EmitFPRSqrtEstimate(BlockOfCode& code, EmitContext& ctx, IR::Inst* i
using FPT = mp::unsigned_integer_of_size<fsize>;
if constexpr (fsize != 16) {
if (ctx.UnsafeOptimizations()) {
if (ctx.HasOptimization(OptimizationFlag::Unsafe_ReducedErrorFP)) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
const Xbyak::Xmm operand = ctx.reg_alloc.UseXmm(args[0]);
const Xbyak::Xmm result = ctx.reg_alloc.ScratchXmm();