+2005-06-15 David Ung <davidu@mips.com>
+
+ * config/mips/mips.h (GENERATE_MIPS16E): New definition.
+ * config/mips/mips.md (zero_extend<SHORT:mode><GPR:mode>2):
+ Changed expand condition to exclude generating of "and" if
+ GENERATE_MIPS16E is true.
+ (*zero_extend<SHORT:mode><GPR:mode>2_mips16e): New pattern for
+ matching mips16e zeb/zeh.
+ (*extend<SHORT:mode><GPR:mode>2_mips16e): New pattern for matching
+ mips16e seb/seh.
+ (*extend<SHORT:mode><GPR:mode>2): Disable this pattern for
+ GENERATE_MIPS16E.
+ * doc/invoke.texi (MIPS Options): Add comment to -mips16
+ indicating MIPS16e ASE is used if targetting for MIPS32 or MIPS64.
+
2005-06-15 Diego Novillo <dnovillo@redhat.com>
PR 22018
We therefore disable GP-relative switch tables for n64 on IRIX targets. */
#define TARGET_GPWORD (TARGET_ABICALLS && !(mips_abi == ABI_64 && TARGET_IRIX))
- /* Generate mips16 code */
+/* Generate mips16 code */
#define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0)
+/* Generate mips16e code. Default 16bit ASE for mips32/mips32r2/mips64 */
+#define GENERATE_MIPS16E (TARGET_MIPS16 && mips_isa >= 32)
/* Generic ISA defines. */
#define ISA_MIPS1 (mips_isa == 1)
(zero_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand")))]
""
{
- if (TARGET_MIPS16 && !memory_operand (operands[1], <SHORT:MODE>mode))
+ if (TARGET_MIPS16 && !GENERATE_MIPS16E
+ && !memory_operand (operands[1], <SHORT:MODE>mode))
{
emit_insn (gen_and<GPR:mode>3 (operands[0],
gen_lowpart (<GPR:MODE>mode, operands[1]),
[(set_attr "type" "arith,load")
(set_attr "mode" "<GPR:MODE>")])
+(define_insn "*zero_extend<SHORT:mode><GPR:mode>2_mips16e"
+ [(set (match_operand:GPR 0 "register_operand" "=d")
+ (zero_extend:GPR (match_operand:SHORT 1 "register_operand" "0")))]
+ "GENERATE_MIPS16E"
+ "ze<SHORT:size>\t%0"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "<GPR:MODE>")])
+
(define_insn "*zero_extend<SHORT:mode><GPR:mode>2_mips16"
[(set (match_operand:GPR 0 "register_operand" "=d")
(zero_extend:GPR (match_operand:SHORT 1 "memory_operand" "m")))]
(sign_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand")))]
"")
+(define_insn "*extend<SHORT:mode><GPR:mode>2_mips16e"
+ [(set (match_operand:GPR 0 "register_operand" "=d,d")
+ (sign_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand" "0,m")))]
+ "GENERATE_MIPS16E"
+ "@
+ se<SHORT:size>\t%0
+ l<SHORT:size>\t%0,%1"
+ [(set_attr "type" "arith,load")
+ (set_attr "mode" "<GPR:MODE>")])
+
(define_insn_and_split "*extend<SHORT:mode><GPR:mode>2"
[(set (match_operand:GPR 0 "register_operand" "=d,d")
(sign_extend:GPR
(match_operand:SHORT 1 "nonimmediate_operand" "d,m")))]
- "!ISA_HAS_SEB_SEH"
+ "!ISA_HAS_SEB_SEH && !GENERATE_MIPS16E"
"@
#
l<SHORT:size>\t%0,%1"