summaryrefslogtreecommitdiff
path: root/gcc/hsa.h
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-31 17:10:15 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-31 17:10:15 +0000
commit51f0f4fba7ab5951834405a02cced4531f643668 (patch)
tree5ed5ca7dff70ab72534570302bae6e0c19e1b345 /gcc/hsa.h
parent23cf9251aac9e5bfb0036dad048fc9348f6ca175 (diff)
downloadgcc-51f0f4fba7ab5951834405a02cced4531f643668.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/hsa.h')
-rw-r--r--gcc/hsa.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/hsa.h b/gcc/hsa.h
index 1d6baaba9b5..ac692fb7e61 100644
--- a/gcc/hsa.h
+++ b/gcc/hsa.h
@@ -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);