| 1 |
|
| 2 |
# qhasm: int64 xp |
| 3 |
|
| 4 |
# qhasm: int64 yp |
| 5 |
|
| 6 |
# qhasm: int64 ret |
| 7 |
|
| 8 |
# qhasm: input xp |
| 9 |
|
| 10 |
# qhasm: input yp |
| 11 |
|
| 12 |
# qhasm: output ret |
| 13 |
|
| 14 |
# qhasm: int64 t0 |
| 15 |
|
| 16 |
# qhasm: int64 t1 |
| 17 |
|
| 18 |
# qhasm: int64 t2 |
| 19 |
|
| 20 |
# qhasm: int64 t3 |
| 21 |
|
| 22 |
# qhasm: int64 doof |
| 23 |
|
| 24 |
# qhasm: int64 caller1 |
| 25 |
|
| 26 |
# qhasm: int64 caller2 |
| 27 |
|
| 28 |
# qhasm: int64 caller3 |
| 29 |
|
| 30 |
# qhasm: int64 caller4 |
| 31 |
|
| 32 |
# qhasm: int64 caller5 |
| 33 |
|
| 34 |
# qhasm: int64 caller6 |
| 35 |
|
| 36 |
# qhasm: int64 caller7 |
| 37 |
|
| 38 |
# qhasm: caller caller1 |
| 39 |
|
| 40 |
# qhasm: caller caller2 |
| 41 |
|
| 42 |
# qhasm: caller caller3 |
| 43 |
|
| 44 |
# qhasm: caller caller4 |
| 45 |
|
| 46 |
# qhasm: caller caller5 |
| 47 |
|
| 48 |
# qhasm: caller caller6 |
| 49 |
|
| 50 |
# qhasm: caller caller7 |
| 51 |
|
| 52 |
# qhasm: stack64 caller4_stack |
| 53 |
|
| 54 |
# qhasm: stack64 caller5_stack |
| 55 |
|
| 56 |
# qhasm: stack64 caller6_stack |
| 57 |
|
| 58 |
# qhasm: stack64 caller7_stack |
| 59 |
|
| 60 |
# qhasm: enter crypto_sign_ed25519_amd64_64_sc25519_lt |
| 61 |
.text |
| 62 |
.p2align 5 |
| 63 |
.globl _crypto_sign_ed25519_amd64_64_sc25519_lt |
| 64 |
.globl crypto_sign_ed25519_amd64_64_sc25519_lt |
| 65 |
_crypto_sign_ed25519_amd64_64_sc25519_lt: |
| 66 |
crypto_sign_ed25519_amd64_64_sc25519_lt: |
| 67 |
mov %rsp,%r11 |
| 68 |
and $31,%r11 |
| 69 |
add $0,%r11 |
| 70 |
sub %r11,%rsp |
| 71 |
|
| 72 |
# qhasm: t0 = *(uint64 *)(xp + 0) |
| 73 |
# asm 1: movq 0(<xp=int64#1),>t0=int64#3 |
| 74 |
# asm 2: movq 0(<xp=%rdi),>t0=%rdx |
| 75 |
movq 0(%rdi),%rdx |
| 76 |
|
| 77 |
# qhasm: t1 = *(uint64 *)(xp + 8) |
| 78 |
# asm 1: movq 8(<xp=int64#1),>t1=int64#4 |
| 79 |
# asm 2: movq 8(<xp=%rdi),>t1=%rcx |
| 80 |
movq 8(%rdi),%rcx |
| 81 |
|
| 82 |
# qhasm: t2 = *(uint64 *)(xp + 16) |
| 83 |
# asm 1: movq 16(<xp=int64#1),>t2=int64#5 |
| 84 |
# asm 2: movq 16(<xp=%rdi),>t2=%r8 |
| 85 |
movq 16(%rdi),%r8 |
| 86 |
|
| 87 |
# qhasm: t3 = *(uint64 *)(xp + 24) |
| 88 |
# asm 1: movq 24(<xp=int64#1),>t3=int64#1 |
| 89 |
# asm 2: movq 24(<xp=%rdi),>t3=%rdi |
| 90 |
movq 24(%rdi),%rdi |
| 91 |
|
| 92 |
# qhasm: carry? t0 -= *(uint64 *)(yp + 0) |
| 93 |
# asm 1: subq 0(<yp=int64#2),<t0=int64#3 |
| 94 |
# asm 2: subq 0(<yp=%rsi),<t0=%rdx |
| 95 |
subq 0(%rsi),%rdx |
| 96 |
|
| 97 |
# qhasm: carry? t1 -= *(uint64 *)(yp + 8) - carry |
| 98 |
# asm 1: sbbq 8(<yp=int64#2),<t1=int64#4 |
| 99 |
# asm 2: sbbq 8(<yp=%rsi),<t1=%rcx |
| 100 |
sbbq 8(%rsi),%rcx |
| 101 |
|
| 102 |
# qhasm: carry? t2 -= *(uint64 *)(yp + 16) - carry |
| 103 |
# asm 1: sbbq 16(<yp=int64#2),<t2=int64#5 |
| 104 |
# asm 2: sbbq 16(<yp=%rsi),<t2=%r8 |
| 105 |
sbbq 16(%rsi),%r8 |
| 106 |
|
| 107 |
# qhasm: carry? t3 -= *(uint64 *)(yp + 24) - carry |
| 108 |
# asm 1: sbbq 24(<yp=int64#2),<t3=int64#1 |
| 109 |
# asm 2: sbbq 24(<yp=%rsi),<t3=%rdi |
| 110 |
sbbq 24(%rsi),%rdi |
| 111 |
|
| 112 |
# qhasm: ret = 0 |
| 113 |
# asm 1: mov $0,>ret=int64#1 |
| 114 |
# asm 2: mov $0,>ret=%rdi |
| 115 |
mov $0,%rdi |
| 116 |
|
| 117 |
# qhasm: doof = 1 |
| 118 |
# asm 1: mov $1,>doof=int64#2 |
| 119 |
# asm 2: mov $1,>doof=%rsi |
| 120 |
mov $1,%rsi |
| 121 |
|
| 122 |
# qhasm: ret = doof if carry |
| 123 |
# asm 1: cmovc <doof=int64#2,<ret=int64#1 |
| 124 |
# asm 2: cmovc <doof=%rsi,<ret=%rdi |
| 125 |
cmovc %rsi,%rdi |
| 126 |
|
| 127 |
# qhasm: leave |
| 128 |
add %r11,%rsp |
| 129 |
mov %rdi,%rax |
| 130 |
mov %rsi,%rdx |
| 131 |
ret |