Path: blob/21.2-virgl/src/panfrost/bifrost/bifrost_compile.h
4564 views
/*1* Copyright (C) 2018-2019 Alyssa Rosenzweig <[email protected]>2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,19* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE20* SOFTWARE.21*/2223#ifndef __BIFROST_PUBLIC_H_24#define __BIFROST_PUBLIC_H_2526#include "compiler/nir/nir.h"27#include "util/u_dynarray.h"28#include "panfrost/util/pan_ir.h"2930void31bifrost_compile_shader_nir(nir_shader *nir,32const struct panfrost_compile_inputs *inputs,33struct util_dynarray *binary,34struct pan_shader_info *info);3536static const nir_shader_compiler_options bifrost_nir_options = {37.lower_scmp = true,38.lower_flrp16 = true,39.lower_flrp32 = true,40.lower_flrp64 = true,41.lower_ffract = true,42.lower_fmod = true,43.lower_fdiv = true,44.lower_isign = true,45.lower_find_lsb = true,46.lower_ifind_msb = true,47.lower_fdph = true,48.lower_fsqrt = true,4950.lower_wpos_pntc = true,51.lower_fsign = true,5253.lower_bitfield_insert_to_shifts = true,54.lower_bitfield_extract_to_shifts = true,55.lower_extract_byte = true,56.lower_extract_word = true,57.lower_insert_byte = true,58.lower_insert_word = true,59.lower_rotate = true,6061.lower_pack_half_2x16 = true,62.lower_pack_unorm_2x16 = true,63.lower_pack_snorm_2x16 = true,64.lower_pack_unorm_4x8 = true,65.lower_pack_snorm_4x8 = true,66.lower_unpack_half_2x16 = true,67.lower_unpack_unorm_2x16 = true,68.lower_unpack_snorm_2x16 = true,69.lower_unpack_unorm_4x8 = true,70.lower_unpack_snorm_4x8 = true,71.lower_pack_split = true,7273.lower_doubles_options = nir_lower_dmod,74/* TODO: Don't lower supported 64-bit operations */75.lower_int64_options = ~0,76/* TODO: Use IMULD on v7 */77.lower_mul_high = true,78.lower_uadd_carry = true,7980.lower_bitfield_extract_to_shifts = true,81.has_fsub = true,82.has_isub = true,83.vectorize_io = true,84.vectorize_vec2_16bit = true,85.fuse_ffma16 = true,86.fuse_ffma32 = true,87.fuse_ffma64 = true,88.use_interpolated_input_intrinsics = true,8990.lower_uniforms_to_ubo = true,9192.has_cs_global_id = true,93.vertex_id_zero_based = true,94.lower_cs_local_index_from_id = true,95.max_unroll_iterations = 32,96};9798#endif99100101