projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9007c0e
)
ac: fix ac_build_fdiv for f64
author
Marek Olšák
<marek.olsak@amd.com>
Mon, 29 Oct 2018 21:22:03 +0000
(17:22 -0400)
committer
Marek Olšák
<marek.olsak@amd.com>
Mon, 29 Oct 2018 21:24:21 +0000
(17:24 -0400)
trivial
Fixes: a5f35aa742c
src/amd/common/ac_llvm_build.c
patch
|
blob
|
history
diff --git
a/src/amd/common/ac_llvm_build.c
b/src/amd/common/ac_llvm_build.c
index c54a50dcd86a2ee79f240831087bd952a292145a..1392ec0f2389629630eecd55b400e614b7939c8c 100644
(file)
--- a/
src/amd/common/ac_llvm_build.c
+++ b/
src/amd/common/ac_llvm_build.c
@@
-597,7
+597,8
@@
ac_build_fdiv(struct ac_llvm_context *ctx,
* If we do (num * (1 / den)), LLVM does:
* return num * v_rcp_f32(den);
*/
- LLVMValueRef rcp = LLVMBuildFDiv(ctx->builder, ctx->f32_1, den, "");
+ LLVMValueRef one = LLVMTypeOf(num) == ctx->f64 ? ctx->f64_1 : ctx->f32_1;
+ LLVMValueRef rcp = LLVMBuildFDiv(ctx->builder, one, den, "");
LLVMValueRef ret = LLVMBuildFMul(ctx->builder, num, rcp, "");
/* Use v_rcp_f32 instead of precise division. */