1 /* Contributed by Jack Lloyd <lloyd@randombit.net> */
3 /* { dg-options "-O2 -ftree-vectorize" } */
4 /* { dg-options "-O2 -ftree-vectorize -march=nocona" { target { i?86-*-* x86_64-*-* } } } */
6 typedef unsigned long long word
;
8 const unsigned int MP_WORD_BITS
= 64;
9 const word MP_WORD_MASK
= ~((word
)0);
10 const word MP_WORD_TOP_BIT
= (word
)1 << (8*sizeof(word
) - 1);
12 extern void abort (void);
14 word
do_div(word n1
, word n0
, word d
)
16 word high
= n1
% d
, quotient
= 0;
19 for(j
= 0; j
!= MP_WORD_BITS
; ++j
)
21 word high_top_bit
= (high
& MP_WORD_TOP_BIT
);
24 high
|= (n0
>> (MP_WORD_BITS
-1-j
)) & 1;
27 if(high_top_bit
|| high
>= d
)
41 result
= do_div(0x0000000000200000ll
,
43 0x86E53497CE000000ll
);
46 if (result
!= 0x3CBA83)