From: Peter Barada Date: Sat, 29 May 2004 15:17:50 +0000 (+0000) Subject: m68k.c (CONST_METHOD): Add MVZ, MVS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28bad6d14ded53978deea30a09d2a27b0cf35188;p=gcc.git m68k.c (CONST_METHOD): Add MVZ, MVS. * config/m68k/m68k.c (CONST_METHOD): Add MVZ, MVS. * config/m68k/m68k.c (const_method): Likewise. * config/m68k/m68k.c (const_int_cost): Likewise. * config/m68k/m68k.c (const_int_cost): Likewise. * config/m68k/m68k.c (output_move_const_into_data_reg): Likewise. From-SVN: r82421 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca2b422b8fe..3573ee2b56c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,14 @@ 2004-05-29 Peter Barada - * config/m68k/m68k.h(EXTRA_CONSTRAINT): add 'U' for register offset + * config/m68k/m68k.c (CONST_METHOD): Add MVZ, MVS. + * config/m68k/m68k.c (const_method): Likewise. + * config/m68k/m68k.c (const_int_cost): Likewise. + * config/m68k/m68k.c (const_int_cost): Likewise. + * config/m68k/m68k.c (output_move_const_into_data_reg): Likewise. + +2004-05-29 Peter Barada + + * config/m68k/m68k.h (EXTRA_CONSTRAINT): add 'U' for register offset addressing. * config/m68k/m68k.md: Add 'U,U' alternative to ColdFire variants of movsi,movhi,movqi insn patterns. diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 69a62a6ee44..89af89e5a83 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -1470,7 +1470,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, } -typedef enum { MOVL, SWAP, NEGW, NOTW, NOTB, MOVQ } CONST_METHOD; +typedef enum { MOVL, SWAP, NEGW, NOTW, NOTB, MOVQ, MVS, MVZ } CONST_METHOD; static CONST_METHOD const_method (rtx); @@ -1505,6 +1505,16 @@ const_method (rtx constant) if (USE_MOVQ ((u >> 16) | (u << 16))) return SWAP; } + + if (TARGET_CFV4) + { + /* Try using MVZ/MVS with an immedaite value to load constants. */ + if (i >= 0 && i <= 65535) + return MVZ; + if (i >= -32768 && i <= 32767) + return MVS; + } + /* Otherwise, use move.l */ return MOVL; } @@ -1517,6 +1527,8 @@ const_int_cost (rtx constant) case MOVQ : /* Constants between -128 and 127 are cheap due to moveq */ return 0; + case MVZ: + case MVS: case NOTB : case NOTW : case NEGW : @@ -1661,6 +1673,10 @@ output_move_const_into_data_reg (rtx *operands) i = INTVAL (operands[1]); switch (const_method (operands[1])) { + case MVZ: + return "mvsw %1,%0"; + case MVS: + return "mvzw %1,%0"; case MOVQ : return "moveq %1,%0"; case NOTB :