mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
move this fp select into a pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -385,25 +385,6 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ISD::SELECT:
|
|
||||||
if (N->getValueType(0).isFloatingPoint() &&
|
|
||||||
(N->getOperand(0).getOpcode() != ISD::SETCC ||
|
|
||||||
!N->getOperand(0).getOperand(1).getValueType().isFloatingPoint())) {
|
|
||||||
//This should be the condition not covered by the Patterns
|
|
||||||
//FIXME: Don't have SelectCode die, but rather return something testable
|
|
||||||
// so that things like this can be caught in fall though code
|
|
||||||
//move int to fp
|
|
||||||
bool isDouble = N->getValueType(0) == MVT::f64;
|
|
||||||
SDValue cond = N->getOperand(0);
|
|
||||||
SDValue TV = N->getOperand(1);
|
|
||||||
SDValue FV = N->getOperand(2);
|
|
||||||
|
|
||||||
SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, dl, MVT::f64, cond);
|
|
||||||
return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES,
|
|
||||||
dl, MVT::f64, FV, TV, SDValue(LD,0));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ISD::AND: {
|
case ISD::AND: {
|
||||||
ConstantSDNode* SC = NULL;
|
ConstantSDNode* SC = NULL;
|
||||||
ConstantSDNode* MC = NULL;
|
ConstantSDNode* MC = NULL;
|
||||||
|
@ -791,12 +791,14 @@ def : Pat<(select (setule F8RC:$RA, F8RC:$RB), F4RC:$st, F4RC:$sf),
|
|||||||
|
|
||||||
|
|
||||||
let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F4RC:$RA), Fb = 31 in
|
let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F4RC:$RA), Fb = 31 in
|
||||||
def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",[], s_ftoi>; //Floating to integer move, S_floating
|
def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",
|
||||||
|
[(set GPRC:$RC, (bitconvert F4RC:$RA))], s_ftoi>; //Floating to integer move, S_floating
|
||||||
let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F8RC:$RA), Fb = 31 in
|
let OutOperandList = (ops GPRC:$RC), InOperandList = (ops F8RC:$RA), Fb = 31 in
|
||||||
def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC",
|
def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC",
|
||||||
[(set GPRC:$RC, (bitconvert F8RC:$RA))], s_ftoi>; //Floating to integer move
|
[(set GPRC:$RC, (bitconvert F8RC:$RA))], s_ftoi>; //Floating to integer move
|
||||||
let OutOperandList = (ops F4RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
|
let OutOperandList = (ops F4RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
|
||||||
def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",[], s_itof>; //Integer to floating move, S_floating
|
def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",
|
||||||
|
[(set F4RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move, S_floating
|
||||||
let OutOperandList = (ops F8RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
|
let OutOperandList = (ops F8RC:$RC), InOperandList = (ops GPRC:$RA), Fb = 31 in
|
||||||
def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC",
|
def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC",
|
||||||
[(set F8RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move
|
[(set F8RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move
|
||||||
@ -818,6 +820,10 @@ let OutOperandList = (ops F4RC:$RC), InOperandList = (ops F8RC:$RB), Fa = 31 in
|
|||||||
def CVTTS : FPForm<0x16, 0x7AC, "cvtts/sui $RB,$RC",
|
def CVTTS : FPForm<0x16, 0x7AC, "cvtts/sui $RB,$RC",
|
||||||
[(set F4RC:$RC, (fround F8RC:$RB))], s_fadd>;
|
[(set F4RC:$RC, (fround F8RC:$RB))], s_fadd>;
|
||||||
|
|
||||||
|
def : Pat<(select GPRC:$RC, F8RC:$st, F8RC:$sf),
|
||||||
|
(f64 (FCMOVEQT F8RC:$st, F8RC:$sf, (ITOFT GPRC:$RC)))>;
|
||||||
|
def : Pat<(select GPRC:$RC, F4RC:$st, F4RC:$sf),
|
||||||
|
(f32 (FCMOVEQS F4RC:$st, F4RC:$sf, (ITOFT GPRC:$RC)))>;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
//Branching
|
//Branching
|
||||||
|
Reference in New Issue
Block a user