removed artefact cls/pushf/popf

This commit is contained in:
Nikolay Volf 2016-02-25 17:59:08 +03:00
parent fb5779a00e
commit 7525ff23cf

View File

@ -168,7 +168,6 @@ macro_rules! uint_overflowing_mul {
let overflow: u8; let overflow: u8;
unsafe { unsafe {
asm!(" asm!("
clc
mov $5, %rax mov $5, %rax
mulq $9 mulq $9
mov %rax, $0 mov %rax, $0
@ -176,77 +175,59 @@ macro_rules! uint_overflowing_mul {
mov $6, %rax mov $6, %rax
mulq $9 mulq $9
clc add %rax, $1
adc %rax, $1
mov %rdx, $2 mov %rdx, $2
mov $5, %rax mov $5, %rax
pushf
mulq $10 mulq $10
popf add %rax, $1
adc %rax, $1
adc %rdx, $2 adc %rdx, $2
mov $6, %rax mov $6, %rax
mulq $10 mulq $10
clc add %rax, $2
adc %rax, $2
mov %rdx, $3 mov %rdx, $3
mov $7, %rax mov $7, %rax
mulq $9 mulq $9
clc add %rax, $2
adc %rax, $2
adc %rdx, $3 adc %rdx, $3
mov $5, %rax mov $5, %rax
mulq $11 mulq $11
clc add %rax, $2
adc %rax, $2
adc %rdx, $3 adc %rdx, $3
mov $8, %rax mov $8, %rax
pushf
mulq $9 mulq $9
popf
adc %rax, $3 adc %rax, $3
adc $$0, %rdx adc $$0, %rdx
mov %rdx, %rcx mov %rdx, %rcx
clc
mov $7, %rax mov $7, %rax
pushf
mulq $10 mulq $10
popf add %rax, $3
adc %rax, $3
adc $$0, %rdx adc $$0, %rdx
or %rdx, %rcx or %rdx, %rcx
clc
mov $6, %rax mov $6, %rax
pushf
mulq $11 mulq $11
popf add %rax, $3
adc %rax, $3
adc $$0, %rdx adc $$0, %rdx
or %rdx, %rcx or %rdx, %rcx
clc
mov $5, %rax mov $5, %rax
pushf
mulq $12 mulq $12
popf add %rax, $3
adc %rax, $3
adc $$0, %rdx adc $$0, %rdx
or %rdx, %rcx or %rdx, %rcx
clc
cmpq $$0, %rcx cmpq $$0, %rcx
jne 2f jne 2f
mov $8, %rax mov $8, %rax
cmpq $$0, %rax cmpq $$0, %rax
setz %cl sete %cl
mov $7, %rax mov $7, %rax
cmpq $$0, %rax cmpq $$0, %rax
@ -264,7 +245,8 @@ macro_rules! uint_overflowing_mul {
and %dl, %cl and %dl, %cl
2: " 2:
"
: /* $0 */ "={r8}"(result[0]), /* $1 */ "={r9}"(result[1]), /* $2 */ "={r10}"(result[2]), : /* $0 */ "={r8}"(result[0]), /* $1 */ "={r9}"(result[1]), /* $2 */ "={r10}"(result[2]),
/* $3 */ "={r11}"(result[3]), /* $4 */ "={rcx}"(overflow) /* $3 */ "={r11}"(result[3]), /* $4 */ "={rcx}"(overflow)