Skip to content

Commit 2b48ec7

Browse files
Milad Fafrank-dspeed
authored andcommitted
PPC/s390: [compiler] Generalize InstructionSelectorT for Turboshaft (part 12)
Port b65a272 Original Commit Message: This CL ports more of the instruction selector implementation to support Turboshaft. In particular, the handling of: - TryChange R=nicohartmann@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com BUG= LOG=N Change-Id: I3e1771b0972cc209a258562292476e74883cdde2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4775441 Commit-Queue: Milad Farazmand <mfarazma@redhat.com> Reviewed-by: Junliang Yan <junyan@redhat.com> Cr-Commit-Position: refs/heads/main@{#89507}
1 parent 50d9ba9 commit 2b48ec7

2 files changed

Lines changed: 58 additions & 20 deletions

File tree

src/compiler/backend/ppc/instruction-selector-ppc.cc

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,13 +1598,23 @@ void InstructionSelectorT<Adapter>::VisitSignExtendWord16ToInt32(node_t node) {
15981598

15991599
#if V8_TARGET_ARCH_PPC64
16001600
template <typename Adapter>
1601-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToInt64(Node* node) {
1602-
VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
1601+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToInt64(
1602+
node_t node) {
1603+
if constexpr (Adapter::IsTurboshaft) {
1604+
UNIMPLEMENTED();
1605+
} else {
1606+
VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
1607+
}
16031608
}
16041609

16051610
template <typename Adapter>
1606-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt64(Node* node) {
1607-
VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
1611+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt64(
1612+
node_t node) {
1613+
if constexpr (Adapter::IsTurboshaft) {
1614+
UNIMPLEMENTED();
1615+
} else {
1616+
VisitTryTruncateDouble(this, kPPC_DoubleToInt64, node);
1617+
}
16081618
}
16091619

16101620
template <typename Adapter>
@@ -1618,24 +1628,33 @@ void InstructionSelectorT<Adapter>::VisitTruncateFloat64ToInt64(node_t node) {
16181628

16191629
template <typename Adapter>
16201630
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToUint64(
1621-
Node* node) {
1622-
VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
1631+
node_t node) {
1632+
if constexpr (Adapter::IsTurboshaft) {
1633+
UNIMPLEMENTED();
1634+
} else {
1635+
VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
1636+
}
16231637
}
16241638

16251639
template <typename Adapter>
16261640
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToUint64(
1627-
Node* node) {
1628-
VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
1641+
node_t node) {
1642+
if constexpr (Adapter::IsTurboshaft) {
1643+
UNIMPLEMENTED();
1644+
} else {
1645+
VisitTryTruncateDouble(this, kPPC_DoubleToUint64, node);
1646+
}
16291647
}
16301648

16311649
template <typename Adapter>
1632-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt32(Node* node) {
1650+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt32(
1651+
node_t node) {
16331652
UNIMPLEMENTED();
16341653
}
16351654

16361655
template <typename Adapter>
16371656
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToUint32(
1638-
Node* node) {
1657+
node_t node) {
16391658
UNIMPLEMENTED();
16401659
}
16411660

src/compiler/backend/s390/instruction-selector-s390.cc

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,37 +1715,56 @@ WORD64_BIN_OP_LIST(DECLARE_BIN_OP)
17151715

17161716
#if V8_TARGET_ARCH_S390X
17171717
template <typename Adapter>
1718-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToInt64(Node* node) {
1719-
VisitTryTruncateDouble(this, kS390_Float32ToInt64, node);
1718+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToInt64(
1719+
node_t node) {
1720+
if constexpr (Adapter::IsTurboshaft) {
1721+
UNIMPLEMENTED();
1722+
} else {
1723+
VisitTryTruncateDouble(this, kS390_Float32ToInt64, node);
1724+
}
17201725
}
17211726

17221727
template <typename Adapter>
1723-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt64(Node* node) {
1724-
VisitTryTruncateDouble(this, kS390_DoubleToInt64, node);
1728+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt64(
1729+
node_t node) {
1730+
if constexpr (Adapter::IsTurboshaft) {
1731+
UNIMPLEMENTED();
1732+
} else {
1733+
VisitTryTruncateDouble(this, kS390_DoubleToInt64, node);
1734+
}
17251735
}
17261736

17271737
template <typename Adapter>
17281738
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat32ToUint64(
1729-
Node* node) {
1730-
VisitTryTruncateDouble(this, kS390_Float32ToUint64, node);
1739+
node_t node) {
1740+
if constexpr (Adapter::IsTurboshaft) {
1741+
UNIMPLEMENTED();
1742+
} else {
1743+
VisitTryTruncateDouble(this, kS390_Float32ToUint64, node);
1744+
}
17311745
}
17321746

17331747
template <typename Adapter>
17341748
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToUint64(
1735-
Node* node) {
1736-
VisitTryTruncateDouble(this, kS390_DoubleToUint64, node);
1749+
node_t node) {
1750+
if constexpr (Adapter::IsTurboshaft) {
1751+
UNIMPLEMENTED();
1752+
} else {
1753+
VisitTryTruncateDouble(this, kS390_DoubleToUint64, node);
1754+
}
17371755
}
17381756

17391757
#endif
17401758

17411759
template <typename Adapter>
1742-
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt32(Node* node) {
1760+
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToInt32(
1761+
node_t node) {
17431762
UNIMPLEMENTED();
17441763
}
17451764

17461765
template <typename Adapter>
17471766
void InstructionSelectorT<Adapter>::VisitTryTruncateFloat64ToUint32(
1748-
Node* node) {
1767+
node_t node) {
17491768
UNIMPLEMENTED();
17501769
}
17511770

0 commit comments

Comments
 (0)