Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs')
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
index 17135f6c4e4..b88bb7f1002 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
@@ -189,7 +189,7 @@ namespace ILCompiler.DependencyAnalysis.X64
Builder.EmitByte((byte)(0xC0 | (((int)reg & 0x07) << 3) | ((int)reg & 0x07)));
}
- private bool InSignedByteRange(int i)
+ private static bool InSignedByteRange(int i)
{
return i == (int)(sbyte)i;
}
@@ -228,8 +228,7 @@ namespace ILCompiler.DependencyAnalysis.X64
{
byte lowOrderBitsOfBaseReg = (byte)((int)addrMode.BaseReg & 0x07);
modRM |= lowOrderBitsOfBaseReg;
- int offsetSize = 0;
-
+ int offsetSize;
if (addrMode.Offset == 0 && (lowOrderBitsOfBaseReg != (byte)Register.RBP))
{
offsetSize = 0;
@@ -250,7 +249,7 @@ namespace ILCompiler.DependencyAnalysis.X64
if (addrMode.BaseReg == Register.None)
{
- //# ifdef _TARGET_AMD64_
+ //# ifdef _TARGET_AMD64_
// x64 requires SIB to avoid RIP relative address
emitSibByte = true;
//#else
@@ -287,7 +286,7 @@ namespace ILCompiler.DependencyAnalysis.X64
modRM = (byte)((modRM & 0xF8) | (int)Register.RSP);
Builder.EmitByte(modRM);
- int indexRegAsInt = (int)(addrMode.IndexReg.HasValue ? addrMode.IndexReg.Value : Register.RSP);
+ int indexRegAsInt = (int)(addrMode.IndexReg ?? Register.RSP);
Builder.EmitByte((byte)((addrMode.Scale << 6) + ((indexRegAsInt & 0x07) << 3) + ((int)sibByteBaseRegister & 0x07)));
}