Skip to content

Commit

Permalink
add alingment attribute for index_gather_loadXXX
Browse files Browse the repository at this point in the history
  • Loading branch information
subarutaro committed Jul 22, 2021
1 parent d1bcbe9 commit 54fea8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/intermediate_exp_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def convert_to_code(conversion_type,index = nil)
index += ",#{i*@interval.to_i + @offset.to_i}"
end
end
ret += "int #{index_name}[#{nelem}] = {#{index}};\n"
ret += "alignas(32) int #{index_name}[#{nelem}] = {#{index}};\n"
index_simd_width = 32 * nelem
ret += "__m#{index_simd_width}i #{vindex_name} = "
case index_simd_width
Expand All @@ -1081,7 +1081,7 @@ def convert_to_code(conversion_type,index = nil)
index += "#{i*@interval.to_i + @offset.to_i}"
end
end
ret += "int#{size}_t #{index_name}[#{nelem}] = {#{index}};\n"
ret += "alignas(#{size}) int#{size}_t #{index_name}[#{nelem}] = {#{index}};\n"
ret += "__m512i #{vindex_name} = _mm512_load_epi#{size}(#{index_name});\n"
ret += "#{@dest.convert_to_code(conversion_type)} = _mm512_i#{size}gather_#{get_type_suffix_avx512(@type)}(#{vindex_name},#{@src.convert_to_code(conversion_type)},#{scale});"
else
Expand Down

0 comments on commit 54fea8d

Please sign in to comment.