+2013-04-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/56890
+ * config/sparc/sparc.c (enum sparc_mode_class): Add H_MODE value.
+ (S_MODES): Set H_MODE bit.
+ (SF_MODES): Set only S_MODE and SF_MODE bits.
+ (DF_MODES): Set SF_MODES and only D_MODE and DF_MODE bits.
+ (sparc_init_modes) <MODE_INT>: Set H_MODE bit for sub-word modes.
+ <MODE_VECTOR_INT>: Do not set SF_MODE for sub-word modes.
+ <MODE_FLOAT>: Likewise.
+
2013-04-15 Joey Ye <joey.ye@arm.com>
* config/arm/arm.c (thumb_far_jump_used_p): Fix typo in comments.
mapped into one sparc_mode_class mode. */
enum sparc_mode_class {
- S_MODE, D_MODE, T_MODE, O_MODE,
+ H_MODE, S_MODE, D_MODE, T_MODE, O_MODE,
SF_MODE, DF_MODE, TF_MODE, OF_MODE,
CC_MODE, CCFP_MODE
};
/* Modes for single-word and smaller quantities. */
-#define S_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE))
+#define S_MODES \
+ ((1 << (int) H_MODE) | (1 << (int) S_MODE) | (1 << (int) SF_MODE))
/* Modes for double-word and smaller quantities. */
#define D_MODES (S_MODES | (1 << (int) D_MODE) | (1 << DF_MODE))
/* Modes for 8-word and smaller quantities. */
#define O_MODES (T_MODES | (1 << (int) O_MODE) | (1 << (int) OF_MODE))
-/* Modes for single-float quantities. We must allow any single word or
- smaller quantity. This is because the fix/float conversion instructions
- take integer inputs/outputs from the float registers. */
-#define SF_MODES (S_MODES)
+/* Modes for single-float quantities. */
+#define SF_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE))
/* Modes for double-float and smaller quantities. */
-#define DF_MODES (D_MODES)
+#define DF_MODES (SF_MODES | (1 << (int) D_MODE) | (1 << DF_MODE))
/* Modes for quad-float and smaller quantities. */
#define TF_MODES (DF_MODES | (1 << (int) TF_MODE))
case MODE_INT:
case MODE_PARTIAL_INT:
case MODE_COMPLEX_INT:
- if (GET_MODE_SIZE (i) <= 4)
+ if (GET_MODE_SIZE (i) < 4)
+ sparc_mode_class[i] = 1 << (int) H_MODE;
+ else if (GET_MODE_SIZE (i) == 4)
sparc_mode_class[i] = 1 << (int) S_MODE;
else if (GET_MODE_SIZE (i) == 8)
sparc_mode_class[i] = 1 << (int) D_MODE;
sparc_mode_class[i] = 0;
break;
case MODE_VECTOR_INT:
- if (GET_MODE_SIZE (i) <= 4)
- sparc_mode_class[i] = 1 << (int)SF_MODE;
+ if (GET_MODE_SIZE (i) == 4)
+ sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
- sparc_mode_class[i] = 1 << (int)DF_MODE;
+ sparc_mode_class[i] = 1 << (int) DF_MODE;
+ else
+ sparc_mode_class[i] = 0;
break;
case MODE_FLOAT:
case MODE_COMPLEX_FLOAT:
- if (GET_MODE_SIZE (i) <= 4)
+ if (GET_MODE_SIZE (i) == 4)
sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
sparc_mode_class[i] = 1 << (int) DF_MODE;