@@ -63,6 +63,8 @@ StringRef Triple::getArchTypeName(ArchType Kind) {
6363 case renderscript64: return " renderscript64" ;
6464 case riscv32: return " riscv32" ;
6565 case riscv64: return " riscv64" ;
66+ case riscv32be: return " riscv32be" ;
67+ case riscv64be: return " riscv64be" ;
6668 case shave: return " shave" ;
6769 case sparc: return " sparc" ;
6870 case sparcel: return " sparcel" ;
@@ -237,7 +239,10 @@ StringRef Triple::getArchTypePrefix(ArchType Kind) {
237239 case wasm64: return " wasm" ;
238240
239241 case riscv32:
240- case riscv64: return " riscv" ;
242+ case riscv64:
243+ case riscv32be:
244+ case riscv64be:
245+ return " riscv" ;
241246
242247 case ve: return " ve" ;
243248 case csky: return " csky" ;
@@ -452,6 +457,8 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
452457 .Case (" amdgcn" , amdgcn)
453458 .Case (" riscv32" , riscv32)
454459 .Case (" riscv64" , riscv64)
460+ .Case (" riscv32be" , riscv32be)
461+ .Case (" riscv64be" , riscv64be)
455462 .Case (" hexagon" , hexagon)
456463 .Case (" sparc" , sparc)
457464 .Case (" sparcel" , sparcel)
@@ -598,6 +605,8 @@ static Triple::ArchType parseArch(StringRef ArchName) {
598605 .Case (" amdgcn" , Triple::amdgcn)
599606 .Case (" riscv32" , Triple::riscv32)
600607 .Case (" riscv64" , Triple::riscv64)
608+ .Case (" riscv32be" , Triple::riscv32be)
609+ .Case (" riscv64be" , Triple::riscv64be)
601610 .Case (" hexagon" , Triple::hexagon)
602611 .Cases (" s390x" , " systemz" , Triple::systemz)
603612 .Case (" sparc" , Triple::sparc)
@@ -967,6 +976,8 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
967976 case Triple::renderscript64:
968977 case Triple::riscv32:
969978 case Triple::riscv64:
979+ case Triple::riscv32be:
980+ case Triple::riscv64be:
970981 case Triple::shave:
971982 case Triple::sparc:
972983 case Triple::sparcel:
@@ -1689,6 +1700,7 @@ unsigned Triple::getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
16891700 case llvm::Triple::r600:
16901701 case llvm::Triple::renderscript32:
16911702 case llvm::Triple::riscv32:
1703+ case llvm::Triple::riscv32be:
16921704 case llvm::Triple::shave:
16931705 case llvm::Triple::sparc:
16941706 case llvm::Triple::sparcel:
@@ -1719,6 +1731,7 @@ unsigned Triple::getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
17191731 case llvm::Triple::ppc64le:
17201732 case llvm::Triple::renderscript64:
17211733 case llvm::Triple::riscv64:
1734+ case llvm::Triple::riscv64be:
17221735 case llvm::Triple::sparcv9:
17231736 case llvm::Triple::spirv:
17241737 case llvm::Triple::spir64:
@@ -1797,6 +1810,7 @@ Triple Triple::get32BitArchVariant() const {
17971810 case Triple::r600:
17981811 case Triple::renderscript32:
17991812 case Triple::riscv32:
1813+ case Triple::riscv32be:
18001814 case Triple::shave:
18011815 case Triple::sparc:
18021816 case Triple::sparcel:
@@ -1829,6 +1843,9 @@ Triple Triple::get32BitArchVariant() const {
18291843 case Triple::ppc64le: T.setArch (Triple::ppcle); break ;
18301844 case Triple::renderscript64: T.setArch (Triple::renderscript32); break ;
18311845 case Triple::riscv64: T.setArch (Triple::riscv32); break ;
1846+ case Triple::riscv64be:
1847+ T.setArch (Triple::riscv32be);
1848+ break ;
18321849 case Triple::sparcv9: T.setArch (Triple::sparc); break ;
18331850 case Triple::spir64: T.setArch (Triple::spir); break ;
18341851 case Triple::spirv:
@@ -1879,6 +1896,7 @@ Triple Triple::get64BitArchVariant() const {
18791896 case Triple::ppc64le:
18801897 case Triple::renderscript64:
18811898 case Triple::riscv64:
1899+ case Triple::riscv64be:
18821900 case Triple::sparcv9:
18831901 case Triple::spir64:
18841902 case Triple::spirv64:
@@ -1906,6 +1924,9 @@ Triple Triple::get64BitArchVariant() const {
19061924 case Triple::ppcle: T.setArch (Triple::ppc64le); break ;
19071925 case Triple::renderscript32: T.setArch (Triple::renderscript64); break ;
19081926 case Triple::riscv32: T.setArch (Triple::riscv64); break ;
1927+ case Triple::riscv32be:
1928+ T.setArch (Triple::riscv64be);
1929+ break ;
19091930 case Triple::sparc: T.setArch (Triple::sparcv9); break ;
19101931 case Triple::spir: T.setArch (Triple::spir64); break ;
19111932 case Triple::spirv:
@@ -1944,8 +1965,8 @@ Triple Triple::getBigEndianArchVariant() const {
19441965 case Triple::r600:
19451966 case Triple::renderscript32:
19461967 case Triple::renderscript64:
1947- case Triple::riscv32 :
1948- case Triple::riscv64 :
1968+ case Triple::riscv32be :
1969+ case Triple::riscv64be :
19491970 case Triple::shave:
19501971 case Triple::spir64:
19511972 case Triple::spir:
@@ -1978,6 +1999,12 @@ Triple Triple::getBigEndianArchVariant() const {
19781999 break ;
19792000 case Triple::ppcle: T.setArch (Triple::ppc); break ;
19802001 case Triple::ppc64le: T.setArch (Triple::ppc64); break ;
2002+ case Triple::riscv32:
2003+ T.setArch (Triple::riscv32be);
2004+ break ;
2005+ case Triple::riscv64:
2006+ T.setArch (Triple::riscv64be);
2007+ break ;
19812008 case Triple::sparcel: T.setArch (Triple::sparc); break ;
19822009 case Triple::tcele: T.setArch (Triple::tce); break ;
19832010 default :
@@ -2015,6 +2042,12 @@ Triple Triple::getLittleEndianArchVariant() const {
20152042 break ;
20162043 case Triple::ppc: T.setArch (Triple::ppcle); break ;
20172044 case Triple::ppc64: T.setArch (Triple::ppc64le); break ;
2045+ case Triple::riscv32be:
2046+ T.setArch (Triple::riscv32);
2047+ break ;
2048+ case Triple::riscv64be:
2049+ T.setArch (Triple::riscv64);
2050+ break ;
20182051 case Triple::sparc: T.setArch (Triple::sparcel); break ;
20192052 case Triple::tce: T.setArch (Triple::tcele); break ;
20202053 default :
@@ -2053,6 +2086,8 @@ bool Triple::isLittleEndian() const {
20532086 case Triple::renderscript64:
20542087 case Triple::riscv32:
20552088 case Triple::riscv64:
2089+ case Triple::riscv32be:
2090+ case Triple::riscv64be:
20562091 case Triple::shave:
20572092 case Triple::sparcel:
20582093 case Triple::spir64:
0 commit comments