projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33a8eab
)
ac/nir: handle negate modifier
author
Marek Olšák
<marek.olsak@amd.com>
Wed, 24 Jul 2019 03:11:40 +0000
(23:11 -0400)
committer
Marek Olšák
<marek.olsak@amd.com>
Wed, 31 Jul 2019 02:06:23 +0000
(22:06 -0400)
src/amd/common/ac_nir_to_llvm.c
patch
|
blob
|
history
diff --git
a/src/amd/common/ac_nir_to_llvm.c
b/src/amd/common/ac_nir_to_llvm.c
index 826a63773238097027f8c7edd1ba058e812a7f21..f3cb9e879ed8074efbe5bc46147f5040bb735b47 100644
(file)
--- a/
src/amd/common/ac_nir_to_llvm.c
+++ b/
src/amd/common/ac_nir_to_llvm.c
@@
-187,7
+187,18
@@
static LLVMValueRef get_alu_src(struct ac_nir_context *ctx,
swizzle, "");
}
}
- assert(!src.negate);
+
+ if (src.negate) {
+ LLVMTypeRef type = LLVMTypeOf(value);
+ if (LLVMGetTypeKind(type) == LLVMVectorTypeKind)
+ type = LLVMGetElementType(type);
+
+ if (LLVMGetTypeKind(type) == LLVMIntegerTypeKind)
+ value = LLVMBuildNeg(ctx->ac.builder, value, "");
+ else
+ value = LLVMBuildFNeg(ctx->ac.builder, value, "");
+ }
+
assert(!src.abs);
return value;
}