Skip to content

Commit f0ba073

Browse files
ruscurerichte-ibm
authored andcommitted
bigint: Use the asm bn_mul_mont() on powerpc64
Signed-off-by: Russell Currey <[email protected]>
1 parent 1eba9fb commit f0ba073

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

src/arithmetic/bigint.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ fn limbs_mont_mul(r: &mut [Limb], a: &[Limb], m: &[Limb], n0: &N0, _cpu_features
12211221
target_arch = "aarch64",
12221222
target_arch = "arm",
12231223
target_arch = "x86_64",
1224-
target_arch = "x86"
1224+
target_arch = "x86",
1225+
target_arch = "powerpc64"
12251226
))]
12261227
unsafe {
12271228
bn_mul_mont(
@@ -1238,7 +1239,8 @@ fn limbs_mont_mul(r: &mut [Limb], a: &[Limb], m: &[Limb], n0: &N0, _cpu_features
12381239
target_arch = "aarch64",
12391240
target_arch = "arm",
12401241
target_arch = "x86_64",
1241-
target_arch = "x86"
1242+
target_arch = "x86",
1243+
target_arch = "powerpc64"
12421244
)))]
12431245
{
12441246
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
@@ -1278,7 +1280,8 @@ fn limbs_from_mont_in_place(r: &mut [Limb], tmp: &mut [Limb], m: &[Limb], n0: &N
12781280
target_arch = "aarch64",
12791281
target_arch = "arm",
12801282
target_arch = "x86_64",
1281-
target_arch = "x86"
1283+
target_arch = "x86",
1284+
target_arch = "powerpc64"
12821285
)))]
12831286
fn limbs_mul(r: &mut [Limb], a: &[Limb], b: &[Limb]) {
12841287
debug_assert_eq!(r.len(), 2 * a.len());
@@ -1316,7 +1319,8 @@ fn limbs_mont_product(
13161319
target_arch = "aarch64",
13171320
target_arch = "arm",
13181321
target_arch = "x86_64",
1319-
target_arch = "x86"
1322+
target_arch = "x86",
1323+
target_arch = "powerpc64"
13201324
))]
13211325
unsafe {
13221326
bn_mul_mont(
@@ -1333,7 +1337,8 @@ fn limbs_mont_product(
13331337
target_arch = "aarch64",
13341338
target_arch = "arm",
13351339
target_arch = "x86_64",
1336-
target_arch = "x86"
1340+
target_arch = "x86",
1341+
target_arch = "powerpc64"
13371342
)))]
13381343
{
13391344
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
@@ -1350,7 +1355,8 @@ fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, _cpu_features: cpu::Fe
13501355
target_arch = "aarch64",
13511356
target_arch = "arm",
13521357
target_arch = "x86_64",
1353-
target_arch = "x86"
1358+
target_arch = "x86",
1359+
target_arch = "powerpc64"
13541360
))]
13551361
unsafe {
13561362
bn_mul_mont(
@@ -1367,7 +1373,8 @@ fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, _cpu_features: cpu::Fe
13671373
target_arch = "aarch64",
13681374
target_arch = "arm",
13691375
target_arch = "x86_64",
1370-
target_arch = "x86"
1376+
target_arch = "x86",
1377+
target_arch = "powerpc64"
13711378
)))]
13721379
{
13731380
let mut tmp = [0; 2 * MODULUS_MAX_LIMBS];
@@ -1402,7 +1409,8 @@ prefixed_extern! {
14021409
target_arch = "aarch64",
14031410
target_arch = "arm",
14041411
target_arch = "x86_64",
1405-
target_arch = "x86"
1412+
target_arch = "x86",
1413+
target_arch = "powerpc64"
14061414
))
14071415
))]
14081416
prefixed_extern! {

0 commit comments

Comments
 (0)