div64.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
- #ifndef __S390_DIV64
- #define __S390_DIV64
- /* for do_div "base" needs to be smaller than 2^31-1 */
-
- #define do_div(n, base) ({
- unsigned long long __n = (n);
- unsigned long __r;
-
- asm (" slr 0,0n"
- " l 1,%1n"
- " srdl 0,1n"
- " dr 0,%2n"
- " alr 1,1n"
- " alr 0,0n"
- " lhi 2,1n"
- " n 2,%1n"
- " alr 0,2n"
- " clr 0,%2n"
- " jl 0fn"
- " slr 0,%2n"
- " ahi 1,1n"
- "0: st 1,%1n"
- " l 1,4+%1n"
- " srdl 0,1n"
- " dr 0,%2n"
- " alr 1,1n"
- " alr 0,0n"
- " lhi 2,1n"
- " n 2,4+%1n"
- " alr 0,2n"
- " clr 0,%2n"
- " jl 1fn"
- " slr 0,%2n"
- " ahi 1,1n"
- "1: st 1,4+%1n"
- " lr %0,0"
- : "=d" (__r), "+m" (__n)
- : "d" (base) : "0", "1", "2", "cc" );
- (n) = (__n);
- __r;
- })
- #endif