Skip to content

Commit 23fa88b

Browse files
committed
8272413: Incorrect num of element count calculation for vector cast
Backport-of: 7e662e7b9d7ea5113f568418e0acac4234ebfb88
1 parent 2b393f9 commit 23fa88b

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
@@ -1672,8 +1672,7 @@ bool LibraryCallKit::inline_vector_convert() {
16721672
if (num_elem_from < num_elem_to) {
16731673
// Since input and output number of elements are not consistent, we need to make sure we
16741674
// properly size. Thus, first make a cast that retains the number of elements from source.
1675-
// In case the size exceeds the arch size, we do the minimum.
1676-
int num_elem_for_cast = MIN2(num_elem_from, Matcher::max_vector_size(elem_bt_to));
1675+
int num_elem_for_cast = num_elem_from;
16771676

16781677
// It is possible that arch does not support this intermediate vector size
16791678
// TODO More complex logic required here to handle this corner case for the sizes.
@@ -1692,7 +1691,7 @@ bool LibraryCallKit::inline_vector_convert() {
16921691
} else if (num_elem_from > num_elem_to) {
16931692
// Since number elements from input is larger than output, simply reduce size of input (we are supposed to
16941693
// drop top elements anyway).
1695-
int num_elem_for_resize = MAX2(num_elem_to, Matcher::min_vector_size(elem_bt_from));
1694+
int num_elem_for_resize = num_elem_to;
16961695

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

0 commit comments

Comments
 (0)