X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fgallivm%2Flp_bld_struct.h;h=6b7b4f2a6bf7d6949b0f001da9412fec27025ed0;hb=48f4baf63f5a50503907e8b0ea475fd1465c0b1d;hp=147336edb4b3c60c18cd0771c5ef7df25fb2648c;hpb=6fc532ae05352a5540c658580cde08b1e0e9f84c;p=mesa.git diff --git a/src/gallium/auxiliary/gallivm/lp_bld_struct.h b/src/gallium/auxiliary/gallivm/lp_bld_struct.h index 147336edb4b..6b7b4f2a6bf 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_struct.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_struct.h @@ -38,7 +38,7 @@ #include "gallivm/lp_bld.h" -#include +#include "gallivm/lp_bld_init.h" #include "util/u_debug.h" #include "util/u_memory.h" @@ -57,7 +57,7 @@ * Get value pointer to a structure member. */ LLVMValueRef -lp_build_struct_get_ptr(LLVMBuilderRef builder, +lp_build_struct_get_ptr(struct gallivm_state *gallivm, LLVMValueRef ptr, unsigned member, const char *name); @@ -66,10 +66,76 @@ lp_build_struct_get_ptr(LLVMBuilderRef builder, * Get the value of a structure member. */ LLVMValueRef -lp_build_struct_get(LLVMBuilderRef builder, +lp_build_struct_get(struct gallivm_state *gallivm, LLVMValueRef ptr, unsigned member, const char *name); +/** + * Get value pointer to an array element. + */ +LLVMValueRef +lp_build_array_get_ptr(struct gallivm_state *gallivm, + LLVMValueRef ptr, + LLVMValueRef index); + +/** + * Get the value of an array element. + */ +LLVMValueRef +lp_build_array_get(struct gallivm_state *gallivm, + LLVMValueRef ptr, + LLVMValueRef index); + +/** + * Set the value of an array element. + */ +void +lp_build_array_set(struct gallivm_state *gallivm, + LLVMValueRef ptr, + LLVMValueRef index, + LLVMValueRef value); + +/** + * Get the value of an array element. + */ +LLVMValueRef +lp_build_pointer_get(LLVMBuilderRef builder, + LLVMValueRef ptr, + LLVMValueRef index); + +/** + * Get the value of an array element, with explicit alignment. + * + * If the element size is different from the alignment this will + * cause llvm to emit an unaligned load + */ +LLVMValueRef +lp_build_pointer_get_unaligned(LLVMBuilderRef builder, + LLVMValueRef ptr, + LLVMValueRef index, + unsigned alignment); + +/** + * Set the value of an array element. + */ +void +lp_build_pointer_set(LLVMBuilderRef builder, + LLVMValueRef ptr, + LLVMValueRef index, + LLVMValueRef value); + +/** + * Set the value of an array element, with explicit alignment. + * + * If the element size is different from the alignment this will + * cause llvm to emit an unaligned store + */ +void +lp_build_pointer_set_unaligned(LLVMBuilderRef builder, + LLVMValueRef ptr, + LLVMValueRef index, + LLVMValueRef value, + unsigned alignment); #endif /* !LP_BLD_STRUCT_H */