File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -672,6 +672,35 @@ void configt::ansi_ct::set_arch_spec_sh4()
672
672
}
673
673
}
674
674
675
+ void configt::ansi_ct::set_arch_spec_loongarch64 ()
676
+ {
677
+ set_LP64 ();
678
+ endianness = endiannesst::IS_LITTLE_ENDIAN;
679
+ long_double_width = 16 * 8 ;
680
+ char_is_unsigned = false ;
681
+ NULL_is_zero = true ;
682
+
683
+ switch (mode)
684
+ {
685
+ case flavourt::GCC:
686
+ defines.push_back (" __loongarch__" );
687
+ break ;
688
+
689
+ case flavourt::VISUAL_STUDIO:
690
+ UNREACHABLE; // not supported by Visual Studio
691
+ break ;
692
+
693
+ case flavourt::CODEWARRIOR:
694
+ case flavourt::CLANG:
695
+ case flavourt::ARM:
696
+ case flavourt::ANSI:
697
+ break ;
698
+
699
+ case flavourt::NONE:
700
+ UNREACHABLE;
701
+ }
702
+ }
703
+
675
704
configt::ansi_ct::c_standardt configt::ansi_ct::default_c_standard ()
676
705
{
677
706
#if defined(__APPLE__)
@@ -756,6 +785,8 @@ void configt::set_arch(const irep_idt &arch)
756
785
ansi_c.set_arch_spec_x86_64 ();
757
786
else if (arch==" i386" )
758
787
ansi_c.set_arch_spec_i386 ();
788
+ else if (arch == " loongarch64" )
789
+ ansi_c.set_arch_spec_loongarch64 ();
759
790
else
760
791
{
761
792
// We run on something new and unknown.
@@ -1433,6 +1464,8 @@ irep_idt configt::this_architecture()
1433
1464
this_arch = " hppa" ;
1434
1465
#elif defined(__sh__)
1435
1466
this_arch = " sh4" ;
1467
+ #elif defined(__loongarch__)
1468
+ this_arch = " loongarch64" ;
1436
1469
#else
1437
1470
// something new and unknown!
1438
1471
this_arch = " unknown" ;
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ class configt
238
238
void set_arch_spec_v850();
239
239
void set_arch_spec_hppa();
240
240
void set_arch_spec_sh4();
241
+ void set_arch_spec_loongarch64();
241
242
242
243
enum class flavourt
243
244
{
You can’t perform that action at this time.
0 commit comments