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()
672672 }
673673}
674674
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+
675704configt::ansi_ct::c_standardt configt::ansi_ct::default_c_standard ()
676705{
677706#if defined(__APPLE__)
@@ -756,6 +785,8 @@ void configt::set_arch(const irep_idt &arch)
756785 ansi_c.set_arch_spec_x86_64 ();
757786 else if (arch==" i386" )
758787 ansi_c.set_arch_spec_i386 ();
788+ else if (arch == " loongarch64" )
789+ ansi_c.set_arch_spec_loongarch64 ();
759790 else
760791 {
761792 // We run on something new and unknown.
@@ -1433,6 +1464,8 @@ irep_idt configt::this_architecture()
14331464 this_arch = " hppa" ;
14341465 #elif defined(__sh__)
14351466 this_arch = " sh4" ;
1467+ #elif defined(__loongarch__)
1468+ this_arch = " loongarch64" ;
14361469 #else
14371470 // something new and unknown!
14381471 this_arch = " unknown" ;
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ class configt
238238 void set_arch_spec_v850();
239239 void set_arch_spec_hppa();
240240 void set_arch_spec_sh4();
241+ void set_arch_spec_loongarch64();
241242
242243 enum class flavourt
243244 {
You can’t perform that action at this time.
0 commit comments