16-bit med3 is only supported on GFX9+.
Fixes dEQP-VK.spirv_assembly.instruction.amd_trinary_minmax.mid3.f16.*.
Fixes: d6a07732c9c ("ac: use llvm.amdgcn.fmed3 intrinsic for nir_op_fmed3")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3962>
{
LLVMValueRef result;
- if (bitsize == 64) {
- /* Lower 64-bit fmed because LLVM doesn't expose an intrinsic. */
+ if (bitsize == 64 || (bitsize == 16 && ctx->chip_class <= GFX8)) {
+ /* Lower 64-bit fmed because LLVM doesn't expose an intrinsic,
+ * or lower 16-bit fmed because it's only supported on GFX9+.
+ */
LLVMValueRef min1, min2, max1;
min1 = ac_build_fmin(ctx, src0, src1);