< prev index next >

test/jdk/jdk/incubator/vector/templates/Unit-header.template

Print this page

        

*** 268,277 **** --- 268,289 ---- } catch (AssertionError e) { Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } + static void assertBroadcastArraysEquals($type$[] a, $type$[] b, $type$[] r, FBinOp f) { + int i = 0; + try { + for (; i < a.length; i++) { + Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + } + } catch (AssertionError e) { + Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); + } + } + static void assertArraysEquals($type$[] a, $type$[] b, $type$[] r, boolean[] mask, FBinOp f) { assertArraysEquals(a, b, r, mask, FBinMaskOp.lift(f)); } static void assertArraysEquals($type$[] a, $type$[] b, $type$[] r, boolean[] mask, FBinMaskOp f) {
*** 283,292 **** --- 295,322 ---- } catch (AssertionError err) { Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } + static void assertBroadcastArraysEquals($type$[] a, $type$[] b, $type$[] r, boolean[] mask, FBinOp f) { + assertBroadcastArraysEquals(a, b, r, mask, FBinMaskOp.lift(f)); + } + + static void assertBroadcastArraysEquals($type$[] a, $type$[] b, $type$[] r, boolean[] mask, FBinMaskOp f) { + int i = 0; + try { + for (; i < a.length; i++) { + Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + } + } catch (AssertionError err) { + Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + + mask[i % SPECIES.length()]); + } + } + static void assertShiftArraysEquals($type$[] a, $type$[] b, $type$[] r, FBinOp f) { int i = 0; int j = 0; try { for (; j < a.length; j += SPECIES.length()) {
< prev index next >