Skip to content

Commit

Permalink
bigint: Use the asm bn_mul_mont() on powerpc64
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Currey <ruscur@russell.cc>
  • Loading branch information
ruscur authored and erichte-ibm committed Mar 11, 2022
1 parent 1eba9fb commit f0ba073
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/arithmetic/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,8 @@ fn limbs_mont_mul(r: &mut [Limb], a: &[Limb], m: &[Limb], n0: &N0, _cpu_features
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
))]
unsafe {
bn_mul_mont(
Expand All @@ -1238,7 +1239,8 @@ fn limbs_mont_mul(r: &mut [Limb], a: &[Limb], m: &[Limb], n0: &N0, _cpu_features
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
)))]
{
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
Expand Down Expand Up @@ -1278,7 +1280,8 @@ fn limbs_from_mont_in_place(r: &mut [Limb], tmp: &mut [Limb], m: &[Limb], n0: &N
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
)))]
fn limbs_mul(r: &mut [Limb], a: &[Limb], b: &[Limb]) {
debug_assert_eq!(r.len(), 2 * a.len());
Expand Down Expand Up @@ -1316,7 +1319,8 @@ fn limbs_mont_product(
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
))]
unsafe {
bn_mul_mont(
Expand All @@ -1333,7 +1337,8 @@ fn limbs_mont_product(
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
)))]
{
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
Expand All @@ -1350,7 +1355,8 @@ fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, _cpu_features: cpu::Fe
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
))]
unsafe {
bn_mul_mont(
Expand All @@ -1367,7 +1373,8 @@ fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, _cpu_features: cpu::Fe
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
)))]
{
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
Expand Down Expand Up @@ -1402,7 +1409,8 @@ prefixed_extern! {
target_arch = "aarch64",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "x86"
target_arch = "x86",
target_arch = "powerpc64"
))
))]
prefixed_extern! {
Expand Down

0 comments on commit f0ba073

Please sign in to comment.