On Fri, Mar 16, 2018 at 5:50 AM, Daniel Schürmann < [email protected]> wrote:
> Co-authored-by: Connor Abbott <[email protected]> > Signed-off-by: Daniel Schürmann <[email protected]> > --- > src/amd/common/ac_llvm_build.c | 475 ++++++++++++++++++++++++++++++ > +++++++++++ > src/amd/common/ac_llvm_build.h | 33 ++- > 2 files changed, 507 insertions(+), 1 deletion(-) > > diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_ > build.c > index 67d15d5cb3..e4ae7fdbcc 100644 > --- a/src/amd/common/ac_llvm_build.c > +++ b/src/amd/common/ac_llvm_build.c > @@ -2426,3 +2426,478 @@ LLVMValueRef ac_unpack_param(struct > ac_llvm_context *ctx, LLVMValueRef param, > } > return value; > } > + > +static LLVMValueRef > +_ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, > LLVMValueRef lane) > +{ > + ac_build_optimization_barrier(ctx, &src); > + return ac_build_intrinsic(ctx, > + lane == NULL ? "llvm.amdgcn.readfirstlane" : > "llvm.amdgcn.readlane", > + LLVMTypeOf(src), (LLVMValueRef []) { > + src, lane }, > + lane == NULL ? 1 : 2, > + AC_FUNC_ATTR_NOUNWIND | > NOUNWIND is always set by ac_build_intrinsic and doesn't have to be listed here. Same for all NOUNWIND occurences below. > + AC_FUNC_ATTR_READNONE | > + AC_FUNC_ATTR_CONVERGENT); > +} > + > +/** > + * Builds the "llvm.amdgcn.readlane" or "llvm.amdgcn.readfirstlane" > intrinsic. > + * @param ctx > + * @param src > + * @param lane - id of the lane or NULL for the first active lane > + * @return value of the lane > + */ > +LLVMValueRef > +ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, > LLVMValueRef lane) > +{ > + LLVMTypeRef src_type = LLVMTypeOf(src); > + src = ac_to_integer(ctx, src); > + unsigned bits = LLVMGetIntTypeWidth(LLVMTypeOf(src)); > + LLVMValueRef ret; > add an empty line after declarations Marek
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
