radeonsi: set unsafe fpmath on FP instructions when allowed by R600_DEBUG
authorMarek Olšák <marek.olsak@amd.com>
Sat, 12 Nov 2016 22:10:23 +0000 (23:10 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 15 Nov 2016 18:17:56 +0000 (19:17 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index 624a167c7d51f3e54b29078a613a7a6bd3644f0f..2f38949b88ab4daef7498e84fb3e4181c6789526 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "si_shader_internal.h"
+#include "si_pipe.h"
 #include "radeon/radeon_elf_util.h"
 
 #include "gallivm/lp_bld_const.h"
@@ -1246,7 +1247,10 @@ void si_llvm_context_init(struct si_shader_context *ctx,
        ctx->gallivm.module = LLVMModuleCreateWithNameInContext("tgsi",
                                                ctx->gallivm.context);
        LLVMSetTarget(ctx->gallivm.module, "amdgcn--");
-       ctx->gallivm.builder = LLVMCreateBuilderInContext(ctx->gallivm.context);
+
+       bool unsafe_fpmath = (sscreen->b.debug_flags & DBG_UNSAFE_MATH) != 0;
+       ctx->gallivm.builder = lp_create_builder(ctx->gallivm.context,
+                                                unsafe_fpmath);
 
        struct lp_build_tgsi_context *bld_base = &ctx->soa.bld_base;