diff options
author | Martin Liska <mliska@suse.cz> | 2016-03-31 19:10:15 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-03-31 17:10:15 +0000 |
commit | 320c1a36793e0f408924b38bc006e6b791dceff7 (patch) | |
tree | 5ed5ca7dff70ab72534570302bae6e0c19e1b345 /gcc/hsa.h | |
parent | 8f80cbdb26ca754ff3b6fe6c735eca6dd01401fa (diff) | |
download | gcc-320c1a36793e0f408924b38bc006e6b791dceff7.zip gcc-320c1a36793e0f408924b38bc006e6b791dceff7.tar.gz gcc-320c1a36793e0f408924b38bc006e6b791dceff7.tar.bz2 |
HSA: support alignment for hsa_symbols (PR hsa/70391)
PR hsa/70391
* hsa-brig.c (emit_directive_variable): Emit alignment
according to hsa_symbol::m_align.
* hsa-dump.c (hsa_byte_alignment): Move the function to
another file.
(dump_hsa_symbol): Dump alignment of HSA symbols.
* hsa-gen.c (get_symbol_for_decl): Set-up alignment
of a symbol.
(gen_hsa_addr_with_align): New function.
(hsa_bitmemref_alignment): Use newly added function.
(gen_hsa_insns_for_load): Likewise.
(gen_hsa_insns_for_store): Likewise.
(gen_hsa_memory_copy): New argument added.
(gen_hsa_insns_for_single_assignment): Respect
alignment for assignments processed via
gen_hsa_memory_copy.
(gen_hsa_insns_for_direct_call): Likewise.
(gen_hsa_insns_for_return): Likewise.
(gen_function_def_parameters): Set default
alignment.
* hsa.c (hsa_object_alignment): New function.
(hsa_byte_alignment): Pasted function.
* hsa.h (hsa_symbol::m_align): New field.
From-SVN: r234643
Diffstat (limited to 'gcc/hsa.h')
-rw-r--r-- | gcc/hsa.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -60,7 +60,8 @@ struct hsa_symbol /* Constructor. */ hsa_symbol (BrigType16_t type, BrigSegment8_t segment, BrigLinkage8_t linkage, bool global_scope_p = false, - BrigAllocation allocation = BRIG_ALLOCATION_AUTOMATIC); + BrigAllocation allocation = BRIG_ALLOCATION_AUTOMATIC, + BrigAlignment8_t align = BRIG_ALIGNMENT_8); /* Return total size of the symbol. */ unsigned HOST_WIDE_INT total_byte_size (); @@ -113,6 +114,9 @@ struct hsa_symbol /* Flag used for global variables if a variable is already emitted or not. */ bool m_emitted_to_brig; + /* Alignment of the symbol. */ + BrigAlignment8_t m_align; + private: /* Default constructor. */ hsa_symbol (); @@ -1347,6 +1351,8 @@ bool hsa_type_integer_p (BrigType16_t type); bool hsa_btype_p (BrigType16_t type); BrigAlignment8_t hsa_alignment_encoding (unsigned n); BrigAlignment8_t hsa_natural_alignment (BrigType16_t type); +BrigAlignment8_t hsa_object_alignment (tree t); +unsigned hsa_byte_alignment (BrigAlignment8_t alignment); void hsa_destroy_operand (hsa_op_base *op); void hsa_destroy_insn (hsa_insn_basic *insn); void hsa_add_kern_decl_mapping (tree decl, char *name, unsigned, bool); |