mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Add integer promotion support for vselect
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139692 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a08e255e1e
commit
436fe8498a
@ -64,6 +64,7 @@ void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
|
||||
Res = PromoteIntRes_EXTRACT_VECTOR_ELT(N); break;
|
||||
case ISD::LOAD: Res = PromoteIntRes_LOAD(cast<LoadSDNode>(N));break;
|
||||
case ISD::SELECT: Res = PromoteIntRes_SELECT(N); break;
|
||||
case ISD::VSELECT: Res = PromoteIntRes_VSELECT(N); break;
|
||||
case ISD::SELECT_CC: Res = PromoteIntRes_SELECT_CC(N); break;
|
||||
case ISD::SETCC: Res = PromoteIntRes_SETCC(N); break;
|
||||
case ISD::SHL: Res = PromoteIntRes_SHL(N); break;
|
||||
@ -465,6 +466,14 @@ SDValue DAGTypeLegalizer::PromoteIntRes_SELECT(SDNode *N) {
|
||||
LHS.getValueType(), N->getOperand(0),LHS,RHS);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::PromoteIntRes_VSELECT(SDNode *N) {
|
||||
SDValue Mask = GetPromotedInteger(N->getOperand(0));
|
||||
SDValue LHS = GetPromotedInteger(N->getOperand(1));
|
||||
SDValue RHS = GetPromotedInteger(N->getOperand(2));
|
||||
return DAG.getNode(ISD::VSELECT, N->getDebugLoc(),
|
||||
LHS.getValueType(), Mask, LHS, RHS);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::PromoteIntRes_SELECT_CC(SDNode *N) {
|
||||
SDValue LHS = GetPromotedInteger(N->getOperand(2));
|
||||
SDValue RHS = GetPromotedInteger(N->getOperand(3));
|
||||
|
@ -240,6 +240,7 @@ private:
|
||||
SDValue PromoteIntRes_SADDSUBO(SDNode *N, unsigned ResNo);
|
||||
SDValue PromoteIntRes_SDIV(SDNode *N);
|
||||
SDValue PromoteIntRes_SELECT(SDNode *N);
|
||||
SDValue PromoteIntRes_VSELECT(SDNode *N);
|
||||
SDValue PromoteIntRes_SELECT_CC(SDNode *N);
|
||||
SDValue PromoteIntRes_SETCC(SDNode *N);
|
||||
SDValue PromoteIntRes_SHL(SDNode *N);
|
||||
|
@ -9,6 +9,23 @@ define <4 x float> @vsel_float(<4 x float> %v1, <4 x float> %v2) {
|
||||
}
|
||||
|
||||
|
||||
;CHECK: vsel_4xi8
|
||||
;CHECK: blendvps
|
||||
;CHECK: ret
|
||||
define <4 x i8> @vsel_4xi8(<4 x i8> %v1, <4 x i8> %v2) {
|
||||
%vsel = select <4 x i1> <i1 true, i1 false, i1 false, i1 false>, <4 x i8> %v1, <4 x i8> %v2
|
||||
ret <4 x i8> %vsel
|
||||
}
|
||||
|
||||
;CHECK: vsel_4xi16
|
||||
;CHECK: blendvps
|
||||
;CHECK: ret
|
||||
define <4 x i16> @vsel_4xi16(<4 x i16> %v1, <4 x i16> %v2) {
|
||||
%vsel = select <4 x i1> <i1 true, i1 false, i1 false, i1 false>, <4 x i16> %v1, <4 x i16> %v2
|
||||
ret <4 x i16> %vsel
|
||||
}
|
||||
|
||||
|
||||
;CHECK: vsel_i32
|
||||
;CHECK: blendvps
|
||||
;CHECK: ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user