nir,amd: remove trinary_minmax opcodes
[mesa.git] / src / amd / common / ac_rtld.c
index a1bb51a8a88861cc4e7e8202e6b1777fb46ee155..e512b8f73275686b228297602b94c6b876667443 100644 (file)
@@ -82,9 +82,9 @@ struct ac_rtld_part {
 static void report_erroraf(const char *fmt, va_list va)
 {
        char *msg;
-       int ret = asprintf(&msg, fmt, va);
+       int ret = vasprintf(&msg, fmt, va);
        if (ret < 0)
-               msg = "(asprintf failed)";
+               msg = "(vasprintf failed)";
 
        fprintf(stderr, "ac_rtld error: %s\n", msg);
 
@@ -271,6 +271,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
        uint64_t pasted_text_size = 0;
        uint64_t rx_align = 1;
        uint64_t rx_size = 0;
+       uint64_t exec_size = 0;
 
 #define report_if(cond) \
        do { \
@@ -370,6 +371,8 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
 
                                        if (!strcmp(s->name, ".text"))
                                                s->is_pasted_text = true;
+
+                                       exec_size += shdr->sh_size;
                                }
 
                                if (s->is_pasted_text) {
@@ -438,6 +441,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
        }
 
        binary->rx_size += rx_size;
+       binary->exec_size = exec_size;
 
        if (i.info->chip_class >= GFX10) {
                /* In gfx10, the SQ fetches up to 3 cache lines of 16 dwords
@@ -510,7 +514,8 @@ bool ac_rtld_get_section_by_name(struct ac_rtld_binary *binary, const char *name
        return get_section_by_name(&binary->parts[0], name, data, nbytes);
 }
 
-bool ac_rtld_read_config(struct ac_rtld_binary *binary,
+bool ac_rtld_read_config(const struct radeon_info *info,
+                        struct ac_rtld_binary *binary,
                         struct ac_shader_config *config)
 {
        for (unsigned i = 0; i < binary->num_parts; ++i) {
@@ -525,7 +530,7 @@ bool ac_rtld_read_config(struct ac_rtld_binary *binary,
                /* TODO: be precise about scratch use? */
                struct ac_shader_config c = {};
                ac_parse_shader_binary_config(config_data, config_nbytes,
-                                             binary->wave_size, true, &c);
+                                             binary->wave_size, true, info, &c);
 
                config->num_sgprs = MAX2(config->num_sgprs, c.num_sgprs);
                config->num_vgprs = MAX2(config->num_vgprs, c.num_vgprs);