OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [config/] [or32/] [or32.md] - Diff between revs 38 and 133

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 38 Rev 133
Line 1... Line 1...
;; Machine description for GNU compiler, OpenRISC 1000 family, OR32 ISA
;; Machine description for GNU compiler, OpenRISC 1000 family, OR32 ISA
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Contributed by Damjan Lampret  in 1999.
;; Contributed by Damjan Lampret  in 1999.
;; Major optimizations by Matjaz Breskvar  in 2005.
;; Major optimizations by Matjaz Breskvar  in 2005.
 
;; Floating point additions by Jungsook Yang  and Julius Baxter 
 
 
;; This file is part of GNU CC.
;; This file is part of GNU CC.
 
 
;; GNU CC is free software; you can redistribute it and/or modify
;; GNU CC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; it under the terms of the GNU General Public License as published by
Line 439... Line 440...
  or32_compare_op0 = operands[0];
  or32_compare_op0 = operands[0];
  or32_compare_op1 = operands[1];
  or32_compare_op1 = operands[1];
  DONE;
  DONE;
})
})
 
 
 
(define_expand "cmpsf"
 
  [(set (reg:CC 32)
 
        (compare:CC (match_operand:SF 0 "register_operand" "")
 
                    (match_operand:SF 1 "register_operand" "")))]
 
  "TARGET_HARD_FLOAT"
 
  {
 
   if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
 
      operands[0] = force_reg (SFmode, operands[0]);
 
      or32_compare_op0 = operands[0];
 
      or32_compare_op1 = operands[1];
 
      DONE;
 
      })
 
 


 
 
;;
;;
;; Conditional branches
;; Conditional branches
;;
;;
Line 596... Line 610...
  ""
  ""
  "@
  "@
   l.sfleui\t%0,%1
   l.sfleui\t%0,%1
   l.sfleu \t%0,%1")
   l.sfleu \t%0,%1")
 
 
 
;; Single precision floating point evaluation instructions
 
(define_insn "*cmpsf_eq"
 
  [(set (reg:CCEQ 32)
 
        (compare:CCEQ (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sfeq.s\t%0,%1")
 
 
 
(define_insn "*cmpsf_ne"
 
  [(set (reg:CCNE 32)
 
        (compare:CCNE (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sfne.s\t%0,%1")
 
 
 
 
 
(define_insn "*cmpsf_gt"
 
  [(set (reg:CCGT 32)
 
        (compare:CCGT (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sfgt.s\t%0,%1")
 
 
 
(define_insn "*cmpsf_ge"
 
  [(set (reg:CCGE 32)
 
        (compare:CCGE (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sfge.s\t%0,%1")
 
 
 
 
 
(define_insn "*cmpsf_lt"
 
  [(set (reg:CCLT 32)
 
        (compare:CCLT (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sflt.s\t%0,%1")
 
 
 
(define_insn "*cmpsf_le"
 
  [(set (reg:CCLE 32)
 
        (compare:CCLE (match_operand:SF 0 "register_operand" "r,r")
 
                      (match_operand:SF 1 "register_operand" "r,r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.sfle.s\t%0,%1")
 
 
(define_insn "*bf"
(define_insn "*bf"
  [(set (pc)
  [(set (pc)
        (if_then_else (match_operator 1 "comparison_operator"
        (if_then_else (match_operator 1 "comparison_operator"
                                      [(match_operand 2
                                      [(match_operand 2
                                                      "cc_reg_operand" "")
                                                      "cc_reg_operand" "")
Line 617... Line 676...
;;
;;
;;
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;
;;
;;
 
 
 
 
(define_insn "movdi"
(define_insn "movdi"
        [(set (match_operand:DI 0 "nonimmediate_operand" "=r, r, m, r")
        [(set (match_operand:DI 0 "nonimmediate_operand" "=r, r, m, r")
              (match_operand:DI 1 "general_operand"      " r, m, r, i"))]
              (match_operand:DI 1 "general_operand"      " r, m, r, i"))]
        ""
        ""
        "*
        "*
Line 1204... Line 1261...
 
 
;;
;;
;; floating point
;; floating point
;;
;;
 
 
 
;; floating point arithmetic
 
 
(define_insn "addsf3"
(define_insn "addsf3"
  [(set (match_operand:SF 0 "register_operand" "=r")
  [(set (match_operand:SF 0 "register_operand" "=r")
        (plus:SF (match_operand:SF 1 "register_operand" "r")
        (plus:SF (match_operand:SF 1 "register_operand" "r")
                 (match_operand:SF 2 "register_operand" "r")))]
                 (match_operand:SF 2 "register_operand" "r")))]
  "TARGET_HARD_FLOAT"
  "TARGET_HARD_FLOAT"
Line 1217... Line 1276...
 
 
(define_insn "adddf3"
(define_insn "adddf3"
  [(set (match_operand:DF 0 "register_operand" "=r")
  [(set (match_operand:DF 0 "register_operand" "=r")
        (plus:DF (match_operand:DF 1 "register_operand" "r")
        (plus:DF (match_operand:DF 1 "register_operand" "r")
                 (match_operand:DF 2 "register_operand" "r")))]
                 (match_operand:DF 2 "register_operand" "r")))]
  "TARGET_HARD_FLOAT"
  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
  "lf.add.d\t%0,%1,%2"
  "lf.add.d\t%0,%1,%2"
  [(set_attr "type"     "fp")
  [(set_attr "type"     "fp")
   (set_attr "length"   "1")])
   (set_attr "length"   "1")])
 
 
(define_insn "subsf3"
(define_insn "subsf3"
Line 1235... Line 1294...
 
 
(define_insn "subdf3"
(define_insn "subdf3"
  [(set (match_operand:DF 0 "register_operand" "=r")
  [(set (match_operand:DF 0 "register_operand" "=r")
        (minus:DF (match_operand:DF 1 "register_operand" "r")
        (minus:DF (match_operand:DF 1 "register_operand" "r")
                 (match_operand:DF 2 "register_operand" "r")))]
                 (match_operand:DF 2 "register_operand" "r")))]
  "TARGET_HARD_FLOAT"
  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
  "lf.sub.d\t%0,%1,%2"
  "lf.sub.d\t%0,%1,%2"
  [(set_attr "type"     "fp")
  [(set_attr "type"     "fp")
   (set_attr "length"   "1")])
   (set_attr "length"   "1")])
 
 
(define_insn "mulsf3"
(define_insn "mulsf3"
Line 1253... Line 1312...
 
 
(define_insn "muldf3"
(define_insn "muldf3"
  [(set (match_operand:DF 0 "register_operand" "=r")
  [(set (match_operand:DF 0 "register_operand" "=r")
        (mult:DF (match_operand:DF 1 "register_operand" "r")
        (mult:DF (match_operand:DF 1 "register_operand" "r")
                 (match_operand:DF 2 "register_operand" "r")))]
                 (match_operand:DF 2 "register_operand" "r")))]
  "TARGET_HARD_FLOAT"
  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
  "lf.mul.d\t%0,%1,%2"
  "lf.mul.d\t%0,%1,%2"
  [(set_attr "type"     "fp")
  [(set_attr "type"     "fp")
   (set_attr "length"   "1")])
   (set_attr "length"   "1")])
 
 
(define_insn "divsf3"
(define_insn "divsf3"
Line 1271... Line 1330...
 
 
(define_insn "divdf3"
(define_insn "divdf3"
  [(set (match_operand:DF 0 "register_operand" "=r")
  [(set (match_operand:DF 0 "register_operand" "=r")
        (div:DF (match_operand:DF 1 "register_operand" "r")
        (div:DF (match_operand:DF 1 "register_operand" "r")
                 (match_operand:DF 2 "register_operand" "r")))]
                 (match_operand:DF 2 "register_operand" "r")))]
  "TARGET_HARD_FLOAT"
  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
  "lf.div.d\t%0,%1,%2"
  "lf.div.d\t%0,%1,%2"
  [(set_attr "type"     "fp")
  [(set_attr "type"     "fp")
   (set_attr "length"   "1")])
   (set_attr "length"   "1")])
 
 
 
;; Conversion between fixed point and floating point.
 
 
 
 
 
(define_insn "floatsisf2"
 
  [(set (match_operand:SF 0 "register_operand" "=r")
 
        (float:SF (match_operand:SI 1 "register_operand" "r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.itof.s\t%0, %1"
 
  [(set_attr "type" "fp")
 
   (set_attr "length" "1")])
 
 
 
;; not working
 
(define_insn "fixunssfsi2"
 
  [(set (match_operand:SI 0 "register_operand" "=r")
 
        (fix:SI (match_operand:SF 1 "register_operand" "r")))]
 
  "TARGET_HARD_FLOAT"
 
  "lf.ftoi.s\t%0, %1"
 
  [(set_attr "type" "fp")
 
   (set_attr "length" "1")])
 
 
 
 
 
;; Moving double and single precision floating point values
 
 
 
(define_insn "movdf"
 
  [(set (match_operand:DF 0 "nonimmediate_operand" "=r, r, m, r")
 
        (match_operand:DF 1 "general_operand"      " r, m, r, i"))]
 
  ""
 
  "*
 
         return or32_output_move_double (operands);
 
        "
 
  [(set_attr "length" "2,2,2,3")])
 
 
 
 
 
(define_insn "movsf"
 
  [(set (match_operand:SF 0 "general_operand" "=r,r,m")
 
        (match_operand:SF 1 "general_operand"  "r,m,r"))]
 
  ""
 
  "@
 
   l.ori   \t%0,%1,0\t # movsf
 
   l.lwz   \t%0,%1\t # movsf
 
   l.sw    \t%0,%1\t # movsf"
 
  [(set_attr "type" "move,load,store")
 
   (set_attr "length" "1,1,1")])
 
 
 
 
;; Local variables:
;; Local variables:
;; mode:emacs-lisp
;; mode:emacs-lisp
;; comment-start: ";; "
;; comment-start: ";; "
;; eval: (set-syntax-table (copy-sequence (syntax-table)))
;; eval: (set-syntax-table (copy-sequence (syntax-table)))

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.