diff options
author | Rhys Perry <[email protected]> | 2018-12-06 14:22:17 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-02-19 11:04:29 +0000 |
commit | 4261edc067949b1b75b1fbdb05353e1dc9967be6 (patch) | |
tree | 8ef68f785766403f911bab5d9157599622213922 /src/amd/common | |
parent | 6790b3a8dbf609ee5093ac4b6194a30a17192433 (diff) |
ac/nir: make ac_build_fdiv support 16-bit floats
v2: don't use ac_get_onef()
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index f033fde6da1..c6bc507358e 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -620,7 +620,7 @@ ac_build_fdiv(struct ac_llvm_context *ctx, * If we do (num * (1 / den)), LLVM does: * return num * v_rcp_f32(den); */ - LLVMValueRef one = LLVMTypeOf(num) == ctx->f64 ? ctx->f64_1 : ctx->f32_1; + LLVMValueRef one = LLVMConstReal(LLVMTypeOf(num), 1.0); LLVMValueRef rcp = LLVMBuildFDiv(ctx->builder, one, den, ""); LLVMValueRef ret = LLVMBuildFMul(ctx->builder, num, rcp, ""); |