case AC_FLOAT_MODE_DEFAULT:
case AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO:
break;
- case AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH:
- flags.setNoSignedZeros();
+
+ case AC_FLOAT_MODE_DEFAULT_OPENGL:
+ /* Allow optimizations to treat the sign of a zero argument or
+ * result as insignificant.
+ */
+ flags.setNoSignedZeros(); /* nsz */
+
+ /* Allow optimizations to use the reciprocal of an argument
+ * rather than perform division.
+ */
+ flags.setAllowReciprocal(); /* arcp */
+
llvm::unwrap(builder)->setFastMathFlags(flags);
break;
}
enum ac_float_mode {
AC_FLOAT_MODE_DEFAULT,
- AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH,
+ AC_FLOAT_MODE_DEFAULT_OPENGL,
AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO,
};
ctx->compiler = compiler;
ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.chip_class, sscreen->info.family,
- AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH, wave_size, 64);
+ AC_FLOAT_MODE_DEFAULT_OPENGL, wave_size, 64);
}
void si_llvm_create_func(struct si_shader_context *ctx, const char *name, LLVMTypeRef *return_types,