2 * vxeh2_vs: vector-enhancements facility 2 vector shift
8 if (v1.d[0] != v2.d[0] || v1.d[1] != v2.d[1]) { \
12 static inline void vsl(S390Vector
*v1
, S390Vector
*v2
, S390Vector
*v3
)
14 asm volatile("vsl %[v1], %[v2], %[v3]\n"
20 static inline void vsra(S390Vector
*v1
, S390Vector
*v2
, S390Vector
*v3
)
22 asm volatile("vsra %[v1], %[v2], %[v3]\n"
28 static inline void vsrl(S390Vector
*v1
, S390Vector
*v2
, S390Vector
*v3
)
30 asm volatile("vsrl %[v1], %[v2], %[v3]\n"
36 static inline void vsld(S390Vector
*v1
, S390Vector
*v2
,
37 S390Vector
*v3
, const uint8_t I
)
39 asm volatile("vsld %[v1], %[v2], %[v3], %[I]\n"
46 static inline void vsrd(S390Vector
*v1
, S390Vector
*v2
,
47 S390Vector
*v3
, const uint8_t I
)
49 asm volatile("vsrd %[v1], %[v2], %[v3], %[I]\n"
56 int main(int argc
, char *argv
[])
58 const S390Vector vt_vsl
= { .d
[0] = 0x7FEDBB32D5AA311Dull
,
59 .d
[1] = 0xBB65AA10912220C0ull
};
60 const S390Vector vt_vsra
= { .d
[0] = 0xF1FE6E7399AA5466ull
,
61 .d
[1] = 0x0E762A5188221044ull
};
62 const S390Vector vt_vsrl
= { .d
[0] = 0x11FE6E7399AA5466ull
,
63 .d
[1] = 0x0E762A5188221044ull
};
64 const S390Vector vt_vsld
= { .d
[0] = 0x7F76EE65DD54CC43ull
,
65 .d
[1] = 0xBB32AA2199108838ull
};
66 const S390Vector vt_vsrd
= { .d
[0] = 0x0E060802040E000Aull
,
67 .d
[1] = 0x0C060802040E000Aull
};
68 S390Vector vs
= { .d
[0] = 0x8FEEDDCCBBAA9988ull
,
69 .d
[1] = 0x7766554433221107ull
};
70 S390Vector vd
= { .d
[0] = 0, .d
[1] = 0 };
71 S390Vector vsi
= { .d
[0] = 0, .d
[1] = 0 };
73 for (int ix
= 0; ix
< 16; ix
++) {
74 vsi
.b
[ix
] = (1 + (5 ^ ~ix
)) & 7;
86 vsld(&vd
, &vs
, &vsi
, 3);
89 vsrd(&vd
, &vs
, &vsi
, 15);