From 00bb4b6208ccd1dfbec9a6ac24a106bafb80ae04 Mon Sep 17 00:00:00 2001 From: Gavin Koch Date: Thu, 12 Feb 1998 11:06:08 +0000 Subject: [PATCH] mips.md (trucndihi2,truncdiqi2): Change these to support mips16. * mips.md (trucndihi2,truncdiqi2): Change these to support mips16. From-SVN: r17868 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.md | 27 ++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4a07cb2a67..e8fc0c8773e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 12 14:04:09 1998 Gavin Koch + + * mips.md (trucndihi2,truncdiqi2): Change these to support + mips16. + Thu Feb 12 11:34:55 1998 Gavin Koch * mips/mips.c (movdi_operand): Direct referances to symbols diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 76e0d43bcea..2745797610f 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -3188,20 +3188,33 @@ move\\t%0,%z4\\n\\ (define_insn "truncdihi2" [(set (match_operand:HI 0 "register_operand" "=d") (truncate:HI (match_operand:DI 1 "se_register_operand" "d")))] - "TARGET_64BIT && !TARGET_MIPS16" - "andi\\t%0,%1,0xffff" + "TARGET_64BIT" + "* +{ + if (TARGET_MIPS16) + return \"dsll\\t%0,%1,48\;dsra\\t%0,48\"; + return \"andi\\t%0,%1,0xffff\"; +}" [(set_attr "type" "darith") (set_attr "mode" "HI") - (set_attr "length" "1")]) - + (set (attr "length") (if_then_else (eq (symbol_ref "mips16") (const_int 0)) + (const_int 1) + (const_int 4)))]) (define_insn "truncdiqi2" [(set (match_operand:QI 0 "register_operand" "=d") (truncate:QI (match_operand:DI 1 "se_register_operand" "d")))] - "TARGET_64BIT && !TARGET_MIPS16" - "andi\\t%0,%1,0x00ff" + "TARGET_64BIT" + "* +{ + if (TARGET_MIPS16) + return \"dsll\\t%0,%1,56\;dsra\\t%0,56\"; + return \"andi\\t%0,%1,0x00ff\"; +}" [(set_attr "type" "darith") (set_attr "mode" "QI") - (set_attr "length" "1")]) + (set (attr "length") (if_then_else (eq (symbol_ref "mips16") (const_int 0)) + (const_int 1) + (const_int 4)))]) ;; Combiner patterns to optimize shift/truncate combinations. (define_insn "" -- 2.30.2