aboutsummaryrefslogtreecommitdiff
path: root/gcc/hsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/hsa.c')
-rw-r--r--gcc/hsa.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/hsa.c b/gcc/hsa.c
index 9eacb59..ff97870 100644
--- a/gcc/hsa.c
+++ b/gcc/hsa.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "hsa.h"
#include "internal-fn.h"
#include "ctype.h"
+#include "builtins.h"
/* Structure containing intermediate HSA representation of the generated
function. */
@@ -570,6 +571,25 @@ hsa_alignment_encoding (unsigned n)
}
}
+/* Return HSA alignment encoding alignment of T got
+ by get_object_alignment. */
+
+BrigAlignment8_t
+hsa_object_alignment (tree t)
+{
+ return hsa_alignment_encoding (get_object_alignment (t));
+}
+
+/* Return byte alignment for given BrigAlignment8_t value. */
+
+unsigned
+hsa_byte_alignment (BrigAlignment8_t alignment)
+{
+ gcc_assert (alignment != BRIG_ALIGNMENT_NONE);
+
+ return 1 << (alignment - 1);
+}
+
/* Return natural alignment of HSA TYPE. */
BrigAlignment8_t