Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,13 +1114,15 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_VSELECT(SDNode *N) {
}

/// If the operand is a vector that needs to be scalarized then the
/// result must be v1i1, so just convert to a scalar SETCC and wrap
/// with a scalar_to_vector since the res type is legal if we got here
/// result must be a single-element vector, so just convert to a scalar
/// SETCC and wrap with a scalar_to_vector since the res type is legal
/// if we got here
SDValue DAGTypeLegalizer::ScalarizeVecOp_VSETCC(SDNode *N) {
assert(N->getValueType(0).isVector() &&
N->getOperand(0).getValueType().isVector() &&
"Operand types must be vectors");
assert(N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type");
assert(N->getValueType(0).getVectorNumElements() == 1 &&
"Expected single-element vector type");

EVT VT = N->getValueType(0);
SDValue LHS = GetScalarizedVector(N->getOperand(0));
Expand Down Expand Up @@ -1150,7 +1152,8 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_VSTRICT_FSETCC(SDNode *N,
assert(N->getValueType(0).isVector() &&
N->getOperand(1).getValueType().isVector() &&
"Operand types must be vectors");
assert(N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type");
assert(N->getValueType(0).getVectorNumElements() == 1 &&
"Expected single-element vector type");

EVT VT = N->getValueType(0);
SDValue Ch = N->getOperand(0);
Expand Down
22 changes: 22 additions & 0 deletions llvm/test/CodeGen/PowerPC/fp128-vector-setcc.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 %s -o - | FileCheck %s

define <4 x i1> @fp(<4 x fp128> %0) {
; CHECK-LABEL: fp:
; CHECK-COUNT-4: bl __eqkf2
; CHECK: blr
Entry:
%1 = fcmp oeq <4 x fp128> %0, zeroinitializer
ret <4 x i1> %1
}

define <4 x i1> @foo(<4 x fp128> %0) strictfp {
; CHECK-LABEL: foo:
; CHECK-COUNT-4: bl __eqkf2
; CHECK: blr
Entry:
%1 = call <4 x i1> @llvm.experimental.constrained.fcmp.v4fp128(<4 x fp128> %0, <4 x fp128> zeroinitializer, metadata !"oeq", metadata !"fpexcept.strict")
ret <4 x i1> %1
}

declare <4 x i1> @llvm.experimental.constrained.fcmp.v4fp128(<4 x fp128>, <4 x fp128>, metadata, metadata)

Loading