diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-26 17:48:19 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-26 17:48:19 +0000 |
commit | bcd6e034e036614c514d7dd928531d6d8798973e (patch) | |
tree | b4408134f40bc68c60e841c12eb3ec75918f91a3 /gcc/hsa-gen.c | |
parent | dfdd30af1c69e2ce0c773fd8edbc79eac5caa71d (diff) | |
download | gcc-bcd6e034e036614c514d7dd928531d6d8798973e.tar.gz |
[hsa/69568] Fix ld instruction type for packed data
2016-02-26 Martin Jambor <mjambor@suse.cz>
PR hsa/69568
* hsa.h (hsa_type_packed_p): Declare.
* hsa.c (hsa_type_packed_p): New function.
* hsa-gen.c (mem_type_for_type): Use unsigned type for packed
loads.
(gen_hsa_insns_for_store): Use hsa_type_packed_p.
* hsa-brig.c (emit_basic_insn): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/hsa-gen.c')
-rw-r--r-- | gcc/hsa-gen.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c index 5c7744bc074..d7d39f09c1e 100644 --- a/gcc/hsa-gen.c +++ b/gcc/hsa-gen.c @@ -754,11 +754,13 @@ mem_type_for_type (BrigType16_t type) unsigned type?). */ if ((type & BRIG_TYPE_PACK_MASK) == BRIG_TYPE_PACK_128) return BRIG_TYPE_B128; - else if (hsa_btype_p (type)) + else if (hsa_btype_p (type) || hsa_type_packed_p (type)) { unsigned bitsize = hsa_type_bit_size (type); if (bitsize < 128) return hsa_uint_for_bitsize (bitsize); + else + return hsa_bittype_for_bitsize (bitsize); } return type; } @@ -2648,7 +2650,7 @@ gen_hsa_insns_for_store (tree lhs, hsa_op_base *src, hsa_bb *hbb) we can modify the above in place. */ if (hsa_op_immed *imm = dyn_cast <hsa_op_immed *> (src)) { - if ((imm->m_type & BRIG_TYPE_PACK_MASK) == BRIG_TYPE_PACK_NONE) + if (!hsa_type_packed_p (imm->m_type)) imm->m_type = mem->m_type; else { |