File tree Expand file tree Collapse file tree 8 files changed +22
-9
lines changed
aot/ILCompiler.Diagnostics
libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable Expand file tree Collapse file tree 8 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp
5858 // 16-byte alignment for __m256.
5959 alignment = new LayoutInt ( 16 ) ;
6060 }
61+ else if ( defType . Context . Target . Architecture == TargetArchitecture . LoongArch64 )
62+ {
63+ // TODO-LoongArch64: Update alignment to proper value when implement LoongArch64 intrinsic.
64+ alignment = new LayoutInt ( 16 ) ;
65+ }
6166 else if ( defType . Context . Target . Architecture == TargetArchitecture . RiscV64 )
6267 {
6368 // TODO-RISCV64: Update alignment to proper value when we implement RISC-V intrinsic.
@@ -86,6 +91,11 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp
8691 // 16-byte alignment for __m256.
8792 alignment = new LayoutInt ( 16 ) ;
8893 }
94+ else if ( defType . Context . Target . Architecture == TargetArchitecture . LoongArch64 )
95+ {
96+ // TODO-LoongArch64: Update alignment to proper value when implement LoongArch64 intrinsic.
97+ alignment = new LayoutInt ( 16 ) ;
98+ }
8999 else if ( defType . Context . Target . Architecture == TargetArchitecture . RiscV64 )
90100 {
91101 // TODO-RISCV64: Update alignment to proper value when we implement RISC-V intrinsic.
Original file line number Diff line number Diff line change @@ -415,9 +415,10 @@ private CompilationResult CompileMethodInternal(IMethodNode methodCodeNodeNeedin
415415 if ( codeSize < _code . Length )
416416 {
417417 if ( _compilation . TypeSystemContext . Target . Architecture != TargetArchitecture . ARM64
418+ && _compilation . TypeSystemContext . Target . Architecture != TargetArchitecture . LoongArch64
418419 && _compilation . TypeSystemContext . Target . Architecture != TargetArchitecture . RiscV64 )
419420 {
420- // For xarch/arm32/RiscV64, the generated code is sometimes smaller than the memory allocated.
421+ // For xarch/arm32/LoongArch64/ RiscV64, the generated code is sometimes smaller than the memory allocated.
421422 // In that case, trim the codeBlock to the actual value.
422423 //
423424 // For arm64, the allocation request of `hotCodeSize` also includes the roData size
Original file line number Diff line number Diff line change @@ -29,12 +29,6 @@ public static uint GetLoongArch64PassStructInRegisterFlags(TypeDesc typeDesc)
2929 return ( uint ) StructFloatFieldInfoFlags . STRUCT_NO_FLOAT_FIELD ;
3030 }
3131
32- //// The SIMD Intrinsic types are meant to be handled specially and should not be passed as struct registers
33- if ( typeDesc . IsIntrinsic )
34- {
35- throw new NotImplementedException ( "For LoongArch64, SIMD would be implemented later" ) ;
36- }
37-
3832 MetadataType mdType = typeDesc as MetadataType ;
3933 Debug . Assert ( mdType != null ) ;
4034
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ private static PerfmapTokensForTarget TranslateTargetDetailsToPerfmapConstants(T
136136 TargetArchitecture . X64 => PerfMapArchitectureToken . X64 ,
137137 TargetArchitecture . X86 => PerfMapArchitectureToken . X86 ,
138138 TargetArchitecture . RiscV64 => PerfMapArchitectureToken . RiscV64 ,
139+ TargetArchitecture . LoongArch64 => PerfMapArchitectureToken . LoongArch64 ,
139140 _ => throw new NotImplementedException ( details . Architecture . ToString ( ) )
140141 } ;
141142
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public enum PerfMapArchitectureToken : uint
2020 X64 = 3 ,
2121 X86 = 4 ,
2222 RiscV64 = 5 ,
23+ LoongArch64 = 6 ,
2324}
2425
2526public enum PerfMapOSToken : uint
Original file line number Diff line number Diff line change @@ -10051,6 +10051,9 @@ void MethodTableBuilder::CheckForSystemTypes()
1005110051 // The Procedure Call Standard for ARM 64-bit (with SVE support) defaults to
1005210052 // 16-byte alignment for __m256.
1005310053
10054+ pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16 ;
10055+ #elif defined(TARGET_LOONGARCH64)
10056+ // TODO-LoongArch64: Update alignment to proper value when implement LoongArch64 intrinsic.
1005410057 pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16 ;
1005510058 #elif defined(TARGET_RISCV64)
1005610059 // TODO-RISCV64: Update alignment to proper value when we implement RISC-V intrinsic.
@@ -10074,6 +10077,9 @@ void MethodTableBuilder::CheckForSystemTypes()
1007410077
1007510078 pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16 ;
1007610079
10080+ #elif defined(TARGET_LOONGARCH64)
10081+ // TODO-LoongArch64: Update alignment to proper value when implement LoongArch64 intrinsic.
10082+ pLayout->m_ManagedLargestAlignmentRequirementOfAllMembers = 16 ;
1007710083 #elif defined(TARGET_RISCV64)
1007810084 // TODO-RISCV64: Update alignment to proper value when we implement RISC-V intrinsic.
1007910085 // RISC-V Vector Extenstion Intrinsic Document
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public ManagedTextSection(
9090 /// If set, the module contains instructions that assume a 64 bit instruction set. For example it may depend on an address being 64 bits.
9191 /// This may be true even if the module contains only IL instructions because of PlatformInvoke and COM interop.
9292 /// </summary>
93- internal bool Requires64bits => Machine == Machine . Amd64 || Machine == Machine . IA64 || Machine == Machine . Arm64 ;
93+ internal bool Requires64bits => Machine == Machine . Amd64 || Machine == Machine . IA64 || Machine == Machine . Arm64 || Machine == Machine . LoongArch64 ;
9494
9595 public bool Is32Bit => ! Requires64bits ;
9696
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ public static PEHeaderBuilder CreateLibraryHeader()
105105 return new PEHeaderBuilder ( imageCharacteristics : Characteristics . ExecutableImage | Characteristics . Dll ) ;
106106 }
107107
108- internal bool Is32Bit => Machine != Machine . Amd64 && Machine != Machine . IA64 && Machine != Machine . Arm64 && Machine != Machine . RiscV64 ;
108+ internal bool Is32Bit => Machine != Machine . Amd64 && Machine != Machine . IA64 && Machine != Machine . Arm64 && Machine != Machine . LoongArch64 && Machine != Machine . RiscV64 ;
109109
110110 internal int ComputeSizeOfPEHeaders ( int sectionCount ) =>
111111 PEBuilder . DosHeaderSize +
You can’t perform that action at this time.
0 commit comments