Index: clang/lib/Headers/intrin.h =================================================================== --- clang/lib/Headers/intrin.h +++ clang/lib/Headers/intrin.h @@ -853,6 +853,18 @@ __asm__ volatile ("nop"); } #endif +#if defined(__x86_64__) +static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS +__shiftleft128(unsigned __int64 l, unsigned __int64 h, unsigned char d) { + __asm__ __volatile__ ("shldq %1, %2, %0" : "+r"(h) : "c"(d), "r"(l)); + return h; +} +static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS +__shiftright128(unsigned __int64 l, unsigned __int64 h, unsigned char d) { + __asm__ __volatile__ ("shrdq %1, %2, %0" : "+r"(l) : "c"(d), "r"(h)); + return l; +} +#endif /*----------------------------------------------------------------------------*\ |* Privileged intrinsics Index: clang/test/Headers/ms-intrin.cpp =================================================================== --- clang/test/Headers/ms-intrin.cpp +++ clang/test/Headers/ms-intrin.cpp @@ -42,6 +42,8 @@ __stosw(0, 0, 0); #ifdef _M_X64 + __shiftleft128(1, 2, 3); + __shiftright128(1, 2, 3); __movsq(0, 0, 0); __stosq(0, 0, 0); #endif