Vector.shiftER, Vector.shiftEL not working as expected.
Richard Startin
richard at openkappa.co.uk
Sun Oct 8 18:03:09 UTC 2017
What are the methods shiftEL and shiftER supposed to do? I read these as "shift elements left/right" and expect them to behave like the PS[L|R]L[W|D|Q] instructions.
Specifically, I expected the code below to print:
[2, 3, 4, 5, 6, 7, 8, 0]
[0, 1, 2, 3, 4, 5, 6, 7]
int[] ymmword = new int[] {1, 2, 3, 4, 5, 6, 7, 8};
int[] result = new int[8];
IntVector.IntSpecies<Shapes.S256Bit> species = (IntVector.IntSpecies<Shapes.S256Bit>)Vector.speciesInstance(Integer.class, Shapes.S_256_BIT);
IntVector<Shapes.256Bit> vector1 = (IntVector<Shapes.256Bit>)species.fromArray(ymmword, 0).shiftEL(1);
vector1.intoArray(result, 0);
System.out.println(Arrays.toString(result));// This prints [0, 1, 2, 3, 4, 5, 6, 7]
IntVector<Shapes.256Bit> vector2 = (IntVector<Shapes.256Bit>)species.fromArray(ymmword, 0).shiftER(1);
vector2.intoArray(result, 0);
System.out.println(Arrays.toString(result)); // This prints [2, 2, 2, 2, 2, 2, 2, 0]
To build the Panama code I followed the instructions at https://software.intel.com/en-us/articles/vector-api-developer-program-for-java
Have I understood the purpose of these methods correctly and is the observed output as expected? For reference is it possible to access the intended assembly snippets for a given method?
Thanks,
Richard
Richard Startin
More information about the panama-dev
mailing list