mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[X86] Correct result type for the flag result of RDSEED and RDRAND nodes. Correct the CC type for the CMOV used with RDSEED/RDRAND.
The flag result was MVT::Glue, but should be MVT::i32. The CC type was MVT::i8, but should be MVT::i32. llvm-svn: 315145
This commit is contained in:
parent
5ca1dd864d
commit
6e50e85aa1
@ -20621,14 +20621,14 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget,
|
||||
case RDSEED:
|
||||
case RDRAND: {
|
||||
// Emit the node with the right value type.
|
||||
SDVTList VTs = DAG.getVTList(Op->getValueType(0), MVT::Glue, MVT::Other);
|
||||
SDVTList VTs = DAG.getVTList(Op->getValueType(0), MVT::i32, MVT::Other);
|
||||
SDValue Result = DAG.getNode(IntrData->Opc0, dl, VTs, Op.getOperand(0));
|
||||
|
||||
// If the value returned by RDRAND/RDSEED was valid (CF=1), return 1.
|
||||
// Otherwise return the value from Rand, which is always 0, casted to i32.
|
||||
SDValue Ops[] = { DAG.getZExtOrTrunc(Result, dl, Op->getValueType(1)),
|
||||
DAG.getConstant(1, dl, Op->getValueType(1)),
|
||||
DAG.getConstant(X86::COND_B, dl, MVT::i32),
|
||||
DAG.getConstant(X86::COND_B, dl, MVT::i8),
|
||||
SDValue(Result.getNode(), 1) };
|
||||
SDValue isValid = DAG.getNode(X86ISD::CMOV, dl,
|
||||
DAG.getVTList(Op->getValueType(1), MVT::Glue),
|
||||
|
Loading…
Reference in New Issue
Block a user