Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/field_5x52_asm_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2013-2014 Diederik Huys, Pieter Wuille * | * Copyright (c) 2013-2014 Diederik Huys, Pieter Wuille * | ||||
* Distributed under the MIT software license, see the accompanying * | * Distributed under the MIT software license, see the accompanying * | ||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.* | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* | ||||
**********************************************************************/ | **********************************************************************/ | ||||
/** | /** | ||||
* Changelog: | * Changelog: | ||||
* - March 2013, Diederik Huys: original version | * - March 2013, Diederik Huys: original version | ||||
* - November 2014, Pieter Wuille: updated to use Peter Dettman's parallel multiplication algorithm | * - November 2014, Pieter Wuille: updated to use Peter Dettman's parallel multiplication algorithm | ||||
* - December 2014, Pieter Wuille: converted from YASM to GCC inline assembly | * - December 2014, Pieter Wuille: converted from YASM to GCC inline assembly | ||||
*/ | */ | ||||
#ifndef _SECP256K1_FIELD_INNER5X52_IMPL_H_ | #ifndef SECP256K1_FIELD_INNER5X52_IMPL_H | ||||
#define _SECP256K1_FIELD_INNER5X52_IMPL_H_ | #define SECP256K1_FIELD_INNER5X52_IMPL_H | ||||
SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) { | SECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) { | ||||
/** | /** | ||||
* Registers: rdx:rax = multiplication accumulator | * Registers: rdx:rax = multiplication accumulator | ||||
* r9:r8 = c | * r9:r8 = c | ||||
* r15:rcx = d | * r15:rcx = d | ||||
* r10-r14 = a0-a4 | * r10-r14 = a0-a4 | ||||
* rbx = b | * rbx = b | ||||
▲ Show 20 Lines • Show All 470 Lines • ▼ Show 20 Lines | __asm__ __volatile__( | ||||
/* r[4] = c */ | /* r[4] = c */ | ||||
"movq %%r8,32(%%rdi)\n" | "movq %%r8,32(%%rdi)\n" | ||||
: "+S"(a), "=m"(tmp1), "=m"(tmp2), "=m"(tmp3) | : "+S"(a), "=m"(tmp1), "=m"(tmp2), "=m"(tmp3) | ||||
: "D"(r) | : "D"(r) | ||||
: "%rax", "%rbx", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory" | : "%rax", "%rbx", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory" | ||||
); | ); | ||||
} | } | ||||
#endif | #endif /* SECP256K1_FIELD_INNER5X52_IMPL_H */ |