}
//------------------------------------------------------------------------
+// genCodeForBT: Generates code for a GT_BT node.
+//
+// Arguments:
+// tree - The node.
+//
+void CodeGen::genCodeForBT(GenTreeOp* bt)
+{
+ assert(bt->OperIs(GT_BT));
+
+ GenTree* op1 = bt->gtGetOp1();
+ GenTree* op2 = bt->gtGetOp2();
+ var_types type = genActualType(op1->TypeGet());
+
+ assert(op1->isUsedFromReg() && op2->isUsedFromReg());
+ assert((genTypeSize(type) >= genTypeSize(TYP_INT)) && (genTypeSize(type) <= genTypeSize(TYP_I_IMPL)));
+
+ genConsumeOperands(bt);
+ // Note that the emitter doesn't fully support INS_bt, it only supports the reg,reg
+ // form and encodes the registers in reverse order. To get the correct order we need
+ // to reverse the operands when calling emitIns_R_R.
+ getEmitter()->emitIns_R_R(INS_bt, emitTypeSize(type), op2->gtRegNum, op1->gtRegNum);
+}
+
+//------------------------------------------------------------------------
// genCodeForJumpTrue: Generates code for jmpTrue statement.
//
// Arguments:
genCodeForSetcc(treeNode->AsCC());
break;
+ case GT_BT:
+ genCodeForBT(treeNode->AsOp());
+ break;
+
case GT_RETURNTRAP:
genCodeForReturnTrap(treeNode->AsOp());
break;
// by GenTreeCC::gtCondition is true.
GTNODE(SETCC , GenTreeCC ,0,GTK_LEAF) // Checks the condition flags and produces 1 if the condition specified
// by GenTreeCC::gtCondition is true and 0 otherwise.
-
+#ifdef _TARGET_XARCH_
+GTNODE(BT , GenTreeOp ,0,GTK_BINOP|GTK_NOVALUE) // The XARCH BT instruction. Like CMP, this sets the condition flags (CF
+ // to be precise) and does not produce a value.
+#endif
//-----------------------------------------------------------------------------
// Other nodes that look like unary/binary operators:
//-----------------------------------------------------------------------------