AC_EXP_PARAM_UNDEFINED = 255, /* deprecated, use AC_EXP_PARAM_DEFAULT_VAL_0000 instead */
};
+enum {
+ AC_EXP_FLAG_COMPRESSED = (1 << 0),
+ AC_EXP_FLAG_DONE = (1 << 1),
+ AC_EXP_FLAG_VALID_MASK = (1 << 2),
+};
+
/* Maps I/O semantics to the actual location used by the lowering pass. */
typedef unsigned (*ac_nir_map_io_driver_location)(unsigned semantic);
#include "ac_llvm_util.h"
#include "ac_shader_abi.h"
#include "ac_shader_util.h"
+#include "ac_nir.h"
#include "nir/nir.h"
#include "nir/nir_deref.h"
#include "sid.h"
result = ac_build_gather_values(&ctx->ac, global_count, instr->num_components);
break;
}
+ case nir_intrinsic_export_amd: {
+ unsigned flags = nir_intrinsic_flags(instr);
+ unsigned target = nir_intrinsic_base(instr);
+ unsigned write_mask = nir_intrinsic_write_mask(instr);
+
+ struct ac_export_args args = {
+ .target = target,
+ .enabled_channels = write_mask,
+ .compr = flags & AC_EXP_FLAG_COMPRESSED,
+ .done = flags & AC_EXP_FLAG_DONE,
+ .valid_mask = flags & AC_EXP_FLAG_VALID_MASK,
+ };
+
+ LLVMValueRef value = get_src(ctx, instr->src[0]);
+ int num_components = ac_get_llvm_num_components(value);
+ for (int i = 0; i < num_components; i++)
+ args.out[i] = ac_llvm_extract_elem(&ctx->ac, value, i);
+
+ ac_build_export(&ctx->ac, &args);
+ break;
+ }
default:
fprintf(stderr, "Unknown intrinsic: ");
nir_print_instr(&instr->instr, stderr);