machmode.h (to_machine_mode): New.
[gcc.git] / gcc / machmode.h
index c978c0a9b52ee61f91d2705652695e7686280f49..f8ff132372909671fa35edf0a3db9cd857f3816f 100644 (file)
@@ -25,6 +25,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 /* Make an enum class that gives all the machine modes.  */
 #include "insn-modes.h"
 
+/* Given MODE as integer value, get the corresponding enum machine_mode
+   enumeration value.  */
+#define to_machine_mode(MODE)  ((enum machine_mode) (MODE))
+
 /* Get the name of mode MODE as a string.  */
 
 extern const char * const mode_name[NUM_MACHINE_MODES];
@@ -115,6 +119,9 @@ extern const unsigned char mode_nunits[NUM_MACHINE_MODES];
 extern const unsigned char mode_wider[NUM_MACHINE_MODES];
 #define GET_MODE_WIDER_MODE(MODE) mode_wider[MODE]
 
+extern const unsigned char mode_2xwider[NUM_MACHINE_MODES];
+#define GET_MODE_2XWIDER_MODE(MODE) mode_2xwider[MODE]
+
 /* Return the mode for data of a given size SIZE and mode class CLASS.
    If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
    The value is BLKmode if no other mode is found.  */