- Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
| Bugzilla Link | 38423 |
| Version | trunk |
| OS | Windows NT |
| CC | @adibiagio,@topperc,@LebedevRI,@rotateright |
Extended Description
I haven't thoroughly tested this but MULHU should be something like:
define <2 x i64> @mulh_2u64(<2 x i64>, <2 x i64>) { %3 = and <2 x i64> %0, <i64 4294967295, i64 4294967295> %4 = lshr <2 x i64> %0, <i64 32, i64 32> %5 = and <2 x i64> %1, <i64 4294967295, i64 4294967295> %6 = lshr <2 x i64> %1, <i64 32, i64 32> %7 = mul nuw <2 x i64> %6, %4 %8 = mul nuw <2 x i64> %5, %4 %9 = mul nuw <2 x i64> %6, %3 %10 = mul nuw <2 x i64> %5, %3 %11 = and <2 x i64> %8, <i64 4294967295, i64 4294967295> %12 = and <2 x i64> %9, <i64 4294967295, i64 4294967295> %13 = add nuw nsw <2 x i64> %11, %12 %14 = lshr <2 x i64> %10, <i64 32, i64 32> %15 = add nuw nsw <2 x i64> %13, %14 %16 = lshr <2 x i64> %15, <i64 32, i64 32> %17 = lshr <2 x i64> %8, <i64 32, i64 32> %18 = add <2 x i64> %17, %7 %19 = lshr <2 x i64> %9, <i64 32, i64 32> %20 = add <2 x i64> %18, %19 %21 = add <2 x i64> %20, %16 ret <2 x i64> %21 }mulh_2u64: vpxor %xmm2, %xmm2, %xmm2 vpblendw $204, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7] vpblendw $204, %xmm2, %xmm1, %xmm4 # xmm4 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7] vpsrlq $32, %xmm0, %xmm0 vpsrlq $32, %xmm1, %xmm1 vpmuludq %xmm0, %xmm1, %xmm5 vpmuludq %xmm3, %xmm1, %xmm1 vpmuludq %xmm0, %xmm4, %xmm0 vpmuludq %xmm3, %xmm4, %xmm3 vpblendw $204, %xmm2, %xmm0, %xmm4 # xmm4 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7] vpblendw $204, %xmm2, %xmm1, %xmm2 # xmm2 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7] vpsrlq $32, %xmm0, %xmm0 vpsrlq $32, %xmm3, %xmm3 vpsrlq $32, %xmm1, %xmm1 vpaddq %xmm2, %xmm4, %xmm2 vpaddq %xmm5, %xmm0, %xmm0 vpaddq %xmm3, %xmm2, %xmm2 vpaddq %xmm1, %xmm0, %xmm0 vpsrlq $32, %xmm2, %xmm2 vpaddq %xmm2, %xmm0, %xmm0 retq