@@ -1514,15 +1514,23 @@ ${assignmentOperatorComment(x.operator, True)}
1514
1514
% end
1515
1515
1516
1516
% dbits = bits*2
1517
- % if bits <= word_bits:
1517
+ % if bits == 64 :
1518
+ #if !(arch(arm) || arch(i386) || arch(wasm32))
1519
+ // On 32b architectures we fall back on the generic implementation,
1520
+ // because LLVM doesn't know how to codegen the 128b multiply we use.
1521
+ //
1522
+ // Note that arm64_32 is a 64b architecture for the purposes of this
1523
+ // check, because we have a 64x64 -> 128 multiply there (the actual
1524
+ // ISA is AArch64).
1525
+ % end
1518
1526
/// Returns a tuple containing the high and low parts of the result of
1519
1527
/// multiplying this value by the given value.
1520
1528
///
1521
1529
/// Use this method to calculate the full result of a product that would
1522
1530
/// otherwise overflow. Unlike traditional truncating multiplication, the
1523
- /// `multipliedFullWidth(by:)` method returns a tuple
1524
- /// containing both the `high` and `low` parts of the product of this value and
1525
- /// `other`. The following example uses this method to multiply two `UInt8`
1531
+ /// `multipliedFullWidth(by:)` method returns a tuple containing both the
1532
+ /// `high` and `low` parts of the product of this value and `other`.
1533
+ /// The following example uses this method to multiply two `UInt8`
1526
1534
/// values that normally overflow when multiplied:
1527
1535
///
1528
1536
/// let x: UInt8 = 100
@@ -1557,6 +1565,8 @@ ${assignmentOperatorComment(x.operator, True)}
1557
1565
let high = ${ Self} ( Builtin . truncOrBitCast_Int ${ dbits} _Int${ bits} ( shifted) )
1558
1566
return ( high: high, low: low)
1559
1567
}
1568
+ % if bits == 64 :
1569
+ #endif
1560
1570
% end
1561
1571
1562
1572
/// Returns a tuple containing the quotient and remainder of dividing the
0 commit comments