mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 18:00:24 +01:00
ac/llvm: Fix DENORM_FLUSH_TO_ZERO with exact instructions
cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25293>
(cherry picked from commit 2b38d4922e)
This commit is contained in:
parent
9060121050
commit
e73e2f26f7
3 changed files with 6 additions and 17 deletions
|
|
@ -734,7 +734,7 @@
|
|||
"description": "ac/llvm: Fix DENORM_FLUSH_TO_ZERO with exact instructions",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
|
||||
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp32.input_args.tanh_denorm_flush_to_zero,Fail
|
||||
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.tanh_denorm_flush_to_zero_frag,Fail
|
||||
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.tanh_denorm_flush_to_zero_vert,Fail
|
||||
|
||||
dEQP-VK.pipeline.monolithic.multisample.storage_image.64x64_1.r32g32b32a32_sfloat.samples_8,Fail
|
||||
dEQP-VK.pipeline.monolithic.multisample.storage_image.64x64_1.r8g8b8a8_unorm.samples_8,Fail
|
||||
dEQP-VK.pipeline.monolithic.multisample.storage_image.64x64_4.r32g32b32a32_sfloat.samples_8,Fail
|
||||
|
|
|
|||
|
|
@ -555,12 +555,6 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
|
|||
case nir_op_fneg:
|
||||
src[0] = ac_to_float(&ctx->ac, src[0]);
|
||||
result = LLVMBuildFNeg(ctx->ac.builder, src[0], "");
|
||||
if (ctx->ac.float_mode == AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO) {
|
||||
/* fneg will be optimized by backend compiler with sign
|
||||
* bit removed via XOR. This is probably a LLVM bug.
|
||||
*/
|
||||
result = ac_build_canonicalize(&ctx->ac, result, instr->def.bit_size);
|
||||
}
|
||||
break;
|
||||
case nir_op_inot:
|
||||
result = LLVMBuildNot(ctx->ac.builder, src[0], "");
|
||||
|
|
@ -704,12 +698,6 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
|
|||
case nir_op_fabs:
|
||||
result =
|
||||
emit_intrin_1f_param(&ctx->ac, "llvm.fabs", ac_to_float_type(&ctx->ac, def_type), src[0]);
|
||||
if (ctx->ac.float_mode == AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO) {
|
||||
/* fabs will be optimized by backend compiler with sign
|
||||
* bit removed via AND.
|
||||
*/
|
||||
result = ac_build_canonicalize(&ctx->ac, result, instr->def.bit_size);
|
||||
}
|
||||
break;
|
||||
case nir_op_fsat:
|
||||
src[0] = ac_to_float(&ctx->ac, src[0]);
|
||||
|
|
@ -1247,6 +1235,11 @@ static bool visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
|
|||
}
|
||||
|
||||
if (result) {
|
||||
LLVMTypeKind type_kind = LLVMGetTypeKind(LLVMTypeOf(result));
|
||||
bool is_float = type_kind == LLVMHalfTypeKind || type_kind == LLVMFloatTypeKind || type_kind == LLVMDoubleTypeKind;
|
||||
if (ctx->ac.float_mode == AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO && is_float)
|
||||
result = ac_build_canonicalize(&ctx->ac, result, instr->def.bit_size);
|
||||
|
||||
result = ac_to_integer_or_pointer(&ctx->ac, result);
|
||||
ctx->ssa_defs[instr->def.index] = result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue