return cnum;
}
+#ifndef LEGACY_BACKEND
+// Generates a float or double data section constant and returns field handle representing
+// the data offset to access the constant. This is called by emitInsBinary() in case
+// of contained float of double constants.
+CORINFO_FIELD_HANDLE emitter::emitFltOrDblConst(GenTreeDblCon* tree, emitAttr attr /*=EA_UNKNOWN*/)
+{
+ if (attr == EA_UNKNOWN)
+ {
+ attr = emitTypeSize(tree->TypeGet());
+ }
+ else
+ {
+ assert(emitTypeSize(tree->TypeGet()) == attr);
+ }
+
+ double constValue = tree->gtDblCon.gtDconVal;
+ void* cnsAddr;
+ float f;
+ bool dblAlign;
+
+ if (attr == EA_4BYTE)
+ {
+ f = forceCastToFloat(constValue);
+ cnsAddr = &f;
+ dblAlign = false;
+ }
+ else
+ {
+ cnsAddr = &constValue;
+ dblAlign = true;
+ }
+
+ // Access to inline data is 'abstracted' by a special type of static member
+ // (produced by eeFindJitDataOffs) which the emitter recognizes as being a reference
+ // to constant data, not a real static field.
+
+ UNATIVE_OFFSET cnsSize = (attr == EA_4BYTE) ? 4 : 8;
+ UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, dblAlign);
+ return emitComp->eeFindJitDataOffs(cnum);
+}
+#endif
+
/*****************************************************************************
*
* Output the given data section at the specified address.
}
}
-// Generates a float or double data section constant and returns field handle representing
-// the data offset to access the constant. This is called by emitInsBinary() in case
-// of contained float of double constants.
-CORINFO_FIELD_HANDLE emitter::emitFltOrDblConst(GenTreeDblCon* tree, emitAttr attr /*=EA_UNKNOWN*/)
-{
- if (attr == EA_UNKNOWN)
- {
- attr = emitTypeSize(tree->TypeGet());
- }
- else
- {
- assert(emitTypeSize(tree->TypeGet()) == attr);
- }
-
- double constValue = tree->gtDblCon.gtDconVal;
- void* cnsAddr;
- float f;
- bool dblAlign;
-
- if (attr == EA_4BYTE)
- {
- f = forceCastToFloat(constValue);
- cnsAddr = &f;
- dblAlign = false;
- }
- else
- {
- cnsAddr = &constValue;
- dblAlign = true;
- }
-
- // Access to inline data is 'abstracted' by a special type of static member
- // (produced by eeFindJitDataOffs) which the emitter recognizes as being a reference
- // to constant data, not a real static field.
-
- UNATIVE_OFFSET cnsSize = (attr == EA_4BYTE) ? 4 : 8;
- UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, dblAlign);
- return emitComp->eeFindJitDataOffs(cnum);
-}
-
// The callee must call genConsumeReg() for any non-contained srcs
// and genProduceReg() for any non-contained dsts.
codeGen->genUpdateLife(varNode);
}
-// Generates a float or double data section constant and returns field handle representing
-// the data offset to access the constant. This is called by emitInsBinary() in case
-// of contained float of double constants.
-CORINFO_FIELD_HANDLE emitter::emitFltOrDblConst(GenTreeDblCon* tree, emitAttr attr /*=EA_UNKNOWN*/)
-{
- if (attr == EA_UNKNOWN)
- {
- attr = emitTypeSize(tree->TypeGet());
- }
- else
- {
- assert(emitTypeSize(tree->TypeGet()) == attr);
- }
-
- double constValue = tree->gtDblCon.gtDconVal;
- void* cnsAddr;
- float f;
- bool dblAlign;
-
- if (attr == EA_4BYTE)
- {
- f = forceCastToFloat(constValue);
- cnsAddr = &f;
- dblAlign = false;
- }
- else
- {
- cnsAddr = &constValue;
- dblAlign = true;
- }
-
- // Access to inline data is 'abstracted' by a special type of static member
- // (produced by eeFindJitDataOffs) which the emitter recognizes as being a reference
- // to constant data, not a real static field.
-
- UNATIVE_OFFSET cnsSize = (attr == EA_4BYTE) ? 4 : 8;
- UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, dblAlign);
- return emitComp->eeFindJitDataOffs(cnum);
-}
-
// The callee must call genConsumeReg() for all sources, including address registers
// of both source and destination, and genProduceReg() for the destination register, if any.