10b57cec5SDimitry Andric //===--- MipsABIFlags.h - MIPS ABI flags ----------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file defines the constants for the ABI flags structure contained
100b57cec5SDimitry Andric // in the .MIPS.abiflags section.
110b57cec5SDimitry Andric //
120b57cec5SDimitry Andric // https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
130b57cec5SDimitry Andric //
140b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #ifndef LLVM_SUPPORT_MIPSABIFLAGS_H
170b57cec5SDimitry Andric #define LLVM_SUPPORT_MIPSABIFLAGS_H
180b57cec5SDimitry Andric 
190b57cec5SDimitry Andric namespace llvm {
200b57cec5SDimitry Andric namespace Mips {
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric // Values for the xxx_size bytes of an ABI flags structure.
230b57cec5SDimitry Andric enum AFL_REG {
240b57cec5SDimitry Andric   AFL_REG_NONE = 0x00, // No registers
250b57cec5SDimitry Andric   AFL_REG_32 = 0x01,   // 32-bit registers
260b57cec5SDimitry Andric   AFL_REG_64 = 0x02,   // 64-bit registers
270b57cec5SDimitry Andric   AFL_REG_128 = 0x03   // 128-bit registers
280b57cec5SDimitry Andric };
290b57cec5SDimitry Andric 
300b57cec5SDimitry Andric // Masks for the ases word of an ABI flags structure.
310b57cec5SDimitry Andric enum AFL_ASE {
320b57cec5SDimitry Andric   AFL_ASE_DSP = 0x00000001,       // DSP ASE
330b57cec5SDimitry Andric   AFL_ASE_DSPR2 = 0x00000002,     // DSP R2 ASE
340b57cec5SDimitry Andric   AFL_ASE_EVA = 0x00000004,       // Enhanced VA Scheme
350b57cec5SDimitry Andric   AFL_ASE_MCU = 0x00000008,       // MCU (MicroController) ASE
360b57cec5SDimitry Andric   AFL_ASE_MDMX = 0x00000010,      // MDMX ASE
370b57cec5SDimitry Andric   AFL_ASE_MIPS3D = 0x00000020,    // MIPS-3D ASE
380b57cec5SDimitry Andric   AFL_ASE_MT = 0x00000040,        // MT ASE
390b57cec5SDimitry Andric   AFL_ASE_SMARTMIPS = 0x00000080, // SmartMIPS ASE
400b57cec5SDimitry Andric   AFL_ASE_VIRT = 0x00000100,      // VZ ASE
410b57cec5SDimitry Andric   AFL_ASE_MSA = 0x00000200,       // MSA ASE
420b57cec5SDimitry Andric   AFL_ASE_MIPS16 = 0x00000400,    // MIPS16 ASE
430b57cec5SDimitry Andric   AFL_ASE_MICROMIPS = 0x00000800, // MICROMIPS ASE
440b57cec5SDimitry Andric   AFL_ASE_XPA = 0x00001000,       // XPA ASE
450b57cec5SDimitry Andric   AFL_ASE_CRC = 0x00008000,       // CRC ASE
460b57cec5SDimitry Andric   AFL_ASE_GINV = 0x00020000       // GINV ASE
470b57cec5SDimitry Andric };
480b57cec5SDimitry Andric 
490b57cec5SDimitry Andric // Values for the isa_ext word of an ABI flags structure.
500b57cec5SDimitry Andric enum AFL_EXT {
510b57cec5SDimitry Andric   AFL_EXT_NONE = 0,         // None
520b57cec5SDimitry Andric   AFL_EXT_XLR = 1,          // RMI Xlr instruction
530b57cec5SDimitry Andric   AFL_EXT_OCTEON2 = 2,      // Cavium Networks Octeon2
540b57cec5SDimitry Andric   AFL_EXT_OCTEONP = 3,      // Cavium Networks OcteonP
550b57cec5SDimitry Andric   AFL_EXT_LOONGSON_3A = 4,  // Loongson 3A
560b57cec5SDimitry Andric   AFL_EXT_OCTEON = 5,       // Cavium Networks Octeon
570b57cec5SDimitry Andric   AFL_EXT_5900 = 6,         // MIPS R5900 instruction
580b57cec5SDimitry Andric   AFL_EXT_4650 = 7,         // MIPS R4650 instruction
590b57cec5SDimitry Andric   AFL_EXT_4010 = 8,         // LSI R4010 instruction
600b57cec5SDimitry Andric   AFL_EXT_4100 = 9,         // NEC VR4100 instruction
610b57cec5SDimitry Andric   AFL_EXT_3900 = 10,        // Toshiba R3900 instruction
620b57cec5SDimitry Andric   AFL_EXT_10000 = 11,       // MIPS R10000 instruction
630b57cec5SDimitry Andric   AFL_EXT_SB1 = 12,         // Broadcom SB-1 instruction
640b57cec5SDimitry Andric   AFL_EXT_4111 = 13,        // NEC VR4111/VR4181 instruction
650b57cec5SDimitry Andric   AFL_EXT_4120 = 14,        // NEC VR4120 instruction
660b57cec5SDimitry Andric   AFL_EXT_5400 = 15,        // NEC VR5400 instruction
670b57cec5SDimitry Andric   AFL_EXT_5500 = 16,        // NEC VR5500 instruction
680b57cec5SDimitry Andric   AFL_EXT_LOONGSON_2E = 17, // ST Microelectronics Loongson 2E
690b57cec5SDimitry Andric   AFL_EXT_LOONGSON_2F = 18, // ST Microelectronics Loongson 2F
700b57cec5SDimitry Andric   AFL_EXT_OCTEON3 = 19      // Cavium Networks Octeon3
710b57cec5SDimitry Andric };
720b57cec5SDimitry Andric 
730b57cec5SDimitry Andric // Values for the flags1 word of an ABI flags structure.
740b57cec5SDimitry Andric enum AFL_FLAGS1 { AFL_FLAGS1_ODDSPREG = 1 };
750b57cec5SDimitry Andric 
760b57cec5SDimitry Andric // MIPS object attribute tags
770b57cec5SDimitry Andric enum {
780b57cec5SDimitry Andric   Tag_GNU_MIPS_ABI_FP = 4,  // Floating-point ABI used by this object file
790b57cec5SDimitry Andric   Tag_GNU_MIPS_ABI_MSA = 8, // MSA ABI used by this object file
800b57cec5SDimitry Andric };
810b57cec5SDimitry Andric 
820b57cec5SDimitry Andric // Values for the fp_abi word of an ABI flags structure
830b57cec5SDimitry Andric // and for the Tag_GNU_MIPS_ABI_FP attribute tag.
840b57cec5SDimitry Andric enum Val_GNU_MIPS_ABI_FP {
850b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_ANY = 0,    // not tagged
860b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_DOUBLE = 1, // hard float / -mdouble-float
870b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_SINGLE = 2, // hard float / -msingle-float
880b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_SOFT = 3,   // soft float
890b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_OLD_64 = 4, // -mips32r2 -mfp64
900b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_XX = 5,     // -mfpxx
910b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_64 = 6,     // -mips32r2 -mfp64
920b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_FP_64A = 7     // -mips32r2 -mfp64 -mno-odd-spreg
930b57cec5SDimitry Andric };
940b57cec5SDimitry Andric 
950b57cec5SDimitry Andric // Values for the Tag_GNU_MIPS_ABI_MSA attribute tag.
960b57cec5SDimitry Andric enum Val_GNU_MIPS_ABI_MSA {
970b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_MSA_ANY = 0, // not tagged
980b57cec5SDimitry Andric   Val_GNU_MIPS_ABI_MSA_128 = 1  // 128-bit MSA
990b57cec5SDimitry Andric };
1000b57cec5SDimitry Andric }
1010b57cec5SDimitry Andric }
1020b57cec5SDimitry Andric 
1030b57cec5SDimitry Andric #endif
104