diff options
| author | bernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-29 15:17:50 +0000 |
|---|---|---|
| committer | bernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-29 15:17:50 +0000 |
| commit | c3f7507dc30ed2dbfd46875fe45f4fbbab2b4561 (patch) | |
| tree | b715490bc817f20b6f9abd58bc2c76176f83e271 | |
| parent | 23391c74d3ff2db6bc7cc1c53735c028855714c7 (diff) | |
| download | ppe42-gcc-c3f7507dc30ed2dbfd46875fe45f4fbbab2b4561.tar.gz ppe42-gcc-c3f7507dc30ed2dbfd46875fe45f4fbbab2b4561.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82421 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 10 | ||||
| -rw-r--r-- | gcc/config/m68k/m68k.c | 18 |
2 files changed, 26 insertions, 2 deletions
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 <peter@the-baradas.com> - * 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 <peter@the-baradas.com> + + * 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 : |

