* [hsa] Fix insn type in gen_hsa_ternary_atomic_for_builtin
@ 2015-09-10 11:33 Martin Jambor
0 siblings, 0 replies; only message in thread
From: Martin Jambor @ 2015-09-10 11:33 UTC (permalink / raw)
To: GCC Patches
Hi,
it turns out I got the HSA types wrong in
gen_hsa_ternary_atomic_for_builtin. The following patch makes the
disassembler/verifier happy. Committed to the branch.
Martin
2015-09-10 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (gen_hsa_ternary_atomic_for_builtin): Fix instruction
type, add a TODO about segments.
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 6e39c78..32a9be0 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -3342,7 +3342,7 @@ gen_hsa_ternary_atomic_for_builtin (bool ret_orig,
tree type = TREE_TYPE (gimple_call_arg (stmt, 1));
BrigType16_t hsa_type = hsa_type_for_scalar_tree_type (type, false);
- BrigType16_t bit_type = hsa_bittype_for_type (hsa_type);
+ BrigType16_t mtype = mem_type_for_type (hsa_type);
hsa_op_reg *dest;
int nops, opcode;
@@ -3362,10 +3362,11 @@ gen_hsa_ternary_atomic_for_builtin (bool ret_orig,
nops = 2;
}
- hsa_insn_atomic *atominsn = new hsa_insn_atomic (nops, opcode, acode,
- bit_type);
+ hsa_insn_atomic *atominsn = new hsa_insn_atomic (nops, opcode, acode, mtype);
hsa_op_address *addr;
addr = get_address_from_value (gimple_call_arg (stmt, 0), hbb, ssa_map);
+ /* TODO: Warn if addr has private segment, because the finalizer will not
+ accept that (and it does not make much sense). */
hsa_op_base *op = hsa_reg_or_immed_for_gimple_op (gimple_call_arg (stmt, 1),
hbb, ssa_map);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-10 11:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 11:33 [hsa] Fix insn type in gen_hsa_ternary_atomic_for_builtin Martin Jambor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).