Skip to content

Commit 7e662e7

Browse files
Wang HuangmiaozhuojunWu Yan
authored andcommitted
8272413: Incorrect num of element count calculation for vector cast
Co-authored-by: Wang Huang <whuang@openjdk.org> Co-authored-by: Miu Zhuojun <mouzhuojun@huawei.com> Co-authored-by: Wu Yan <wuyan@openjdk.org> Reviewed-by: eliu, kvn
1 parent f2f8136 commit 7e662e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/hotspot/share/opto/vectorIntrinsics.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1747,8 +1747,7 @@ bool LibraryCallKit::inline_vector_convert() {
17471747
if (num_elem_from < num_elem_to) {
17481748
// Since input and output number of elements are not consistent, we need to make sure we
17491749
// properly size. Thus, first make a cast that retains the number of elements from source.
1750-
// In case the size exceeds the arch size, we do the minimum.
1751-
int num_elem_for_cast = MIN2(num_elem_from, Matcher::max_vector_size(elem_bt_to));
1750+
int num_elem_for_cast = num_elem_from;
17521751

17531752
// It is possible that arch does not support this intermediate vector size
17541753
// TODO More complex logic required here to handle this corner case for the sizes.
@@ -1767,7 +1766,7 @@ bool LibraryCallKit::inline_vector_convert() {
17671766
} else if (num_elem_from > num_elem_to) {
17681767
// Since number elements from input is larger than output, simply reduce size of input (we are supposed to
17691768
// drop top elements anyway).
1770-
int num_elem_for_resize = MAX2(num_elem_to, Matcher::min_vector_size(elem_bt_from));
1769+
int num_elem_for_resize = num_elem_to;
17711770

17721771
// It is possible that arch does not support this intermediate vector size
17731772
// TODO More complex logic required here to handle this corner case for the sizes.

0 commit comments

Comments
 (0)