ac: fix return type for llvm.amdgcn.frexp.exp.i32.64
[mesa.git] / src / amd / common / ac_llvm_build.c
index 4fd1d14b78f6a154c02469762d8b171df635ae3d..eb9e4504248c88d52dca7895eda984662b08abcb 100644 (file)
@@ -3927,6 +3927,30 @@ ac_build_shuffle(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef ind
                  AC_FUNC_ATTR_CONVERGENT);
 }
 
+LLVMValueRef
+ac_build_frexp_exp(struct ac_llvm_context *ctx, LLVMValueRef src0,
+                  unsigned bitsize)
+{
+       LLVMTypeRef type;
+       char *intr;
+
+       if (bitsize == 16) {
+               intr = "llvm.amdgcn.frexp.exp.i16.f16";
+               type = ctx->i16;
+       } else if (bitsize == 32) {
+               intr = "llvm.amdgcn.frexp.exp.i32.f32";
+               type = ctx->i32;
+       } else {
+               intr = "llvm.amdgcn.frexp.exp.i32.f64";
+               type = ctx->i32;
+       }
+
+       LLVMValueRef params[] = {
+               src0,
+       };
+       return ac_build_intrinsic(ctx, intr, type, params, 1,
+                                 AC_FUNC_ATTR_READNONE);
+}
 LLVMValueRef
 ac_build_frexp_mant(struct ac_llvm_context *ctx, LLVMValueRef src0,
                    unsigned bitsize)