Path: blob/21.2-virgl/src/gallium/auxiliary/gallivm/lp_bld_pack.h
4565 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/**28* @file29* Helper functions for packing/unpacking conversions.30*31* @author Jose Fonseca <[email protected]>32*/333435#ifndef LP_BLD_PACK_H36#define LP_BLD_PACK_H373839#include "pipe/p_compiler.h"4041#include "gallivm/lp_bld.h"424344struct lp_type;4546LLVMValueRef47lp_build_interleave2_half(struct gallivm_state *gallivm,48struct lp_type type,49LLVMValueRef a,50LLVMValueRef b,51unsigned lo_hi);5253LLVMValueRef54lp_build_interleave2(struct gallivm_state *gallivm,55struct lp_type type,56LLVMValueRef a,57LLVMValueRef b,58unsigned lo_hi);5960LLVMValueRef61lp_build_uninterleave1(struct gallivm_state *gallivm,62unsigned num_elems,63LLVMValueRef a,64unsigned lo_hi);6566void67lp_build_unpack2(struct gallivm_state *gallivm,68struct lp_type src_type,69struct lp_type dst_type,70LLVMValueRef src,71LLVMValueRef *dst_lo,72LLVMValueRef *dst_hi);737475void76lp_build_unpack2_native(struct gallivm_state *gallivm,77struct lp_type src_type,78struct lp_type dst_type,79LLVMValueRef src,80LLVMValueRef *dst_lo,81LLVMValueRef *dst_hi);8283void84lp_build_unpack(struct gallivm_state *gallivm,85struct lp_type src_type,86struct lp_type dst_type,87LLVMValueRef src,88LLVMValueRef *dst, unsigned num_dsts);8990LLVMValueRef91lp_build_extract_range(struct gallivm_state *gallivm,92LLVMValueRef src,93unsigned start,94unsigned size);9596LLVMValueRef97lp_build_concat(struct gallivm_state *gallivm,98LLVMValueRef src[],99struct lp_type src_type,100unsigned num_vectors);101102int103lp_build_concat_n(struct gallivm_state *gallivm,104struct lp_type src_type,105LLVMValueRef *src,106unsigned num_srcs,107LLVMValueRef *dst,108unsigned num_dsts);109110111LLVMValueRef112lp_build_packs2(struct gallivm_state *gallivm,113struct lp_type src_type,114struct lp_type dst_type,115LLVMValueRef lo,116LLVMValueRef hi);117118119LLVMValueRef120lp_build_pack2(struct gallivm_state *gallivm,121struct lp_type src_type,122struct lp_type dst_type,123LLVMValueRef lo,124LLVMValueRef hi);125126127LLVMValueRef128lp_build_pack2_native(struct gallivm_state *gallivm,129struct lp_type src_type,130struct lp_type dst_type,131LLVMValueRef lo,132LLVMValueRef hi);133134135LLVMValueRef136lp_build_pack(struct gallivm_state *gallivm,137struct lp_type src_type,138struct lp_type dst_type,139boolean clamped,140const LLVMValueRef *src, unsigned num_srcs);141142143void144lp_build_resize(struct gallivm_state *gallivm,145struct lp_type src_type,146struct lp_type dst_type,147const LLVMValueRef *src, unsigned num_srcs,148LLVMValueRef *dst, unsigned num_dsts);149150151LLVMValueRef152lp_build_pad_vector(struct gallivm_state *gallivm,153LLVMValueRef src,154unsigned dst_length);155156#endif /* !LP_BLD_PACK_H */157158159