;;- Machine description for HP PA-RISC architecture for GCC compiler
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Contributed by the Center for Software Science at the University
;; of Utah.
(UNSPECV_LONGJMP 5) ; builtin_longjmp
])
+;; Maximum pc-relative branch offsets.
+
+;; These numbers are a bit smaller than the maximum allowable offsets
+;; so that a few instructions may be inserted before the actual branch.
+
+(define_constants
+ [(MAX_12BIT_OFFSET 8184) ; 12-bit branch
+ (MAX_17BIT_OFFSET 262100) ; 17-bit branch
+ ])
+
;; Insn type. Used to default other attribute values.
;; type "unary" insns have one input operand (1) and one output operand (0)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "cbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "fbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
[(set_attr "type" "fbranch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 12)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
(cond [(eq (symbol_ref "jump_in_call_delay (insn)") (const_int 1))
(if_then_else (lt (abs (minus (match_dup 0)
(plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(const_int 8))
(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 4)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 20)
;; Short branch has length of 4
;; Long branch has length of 8, 20, 24 or 28
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
(if_then_else (eq_attr "alternative" "1")
(if_then_else (lt (match_dup 3) (pc))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 24)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 28)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 44)
(const_int 40)]
(const_int 48))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 24)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 28)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 44)
;; Extra goo to deal with additional reload insns.
(if_then_else (lt (match_dup 3) (pc))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
(const_int 28)]
(const_int 36))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
;; Short branch has length of 4
;; Long branch has length of 8, 20, 24 or 28
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
(if_then_else (eq_attr "alternative" "1")
(if_then_else (lt (match_dup 3) (pc))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
(const_int 28)]
(const_int 36))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
;; Loop counter in memory or sar case.
;; Extra goo to deal with additional reload insns.
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 8)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 12)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
;; Short branch has length of 4
;; Long branch has length of 8
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
(if_then_else (eq_attr "alternative" "1")
(if_then_else (lt (match_dup 3) (pc))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
(const_int 28)]
(const_int 36))
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 12)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 16)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 32)
;; Loop counter in memory or SAR case.
;; Extra goo to deal with additional reload insns.
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 8)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 12)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 28)
[(set_attr "type" "parallel_branch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "parallel_branch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "parallel_branch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "parallel_branch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)
[(set_attr "type" "parallel_branch")
(set (attr "length")
(cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 8184))
+ (const_int MAX_12BIT_OFFSET))
(const_int 4)
(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
- (const_int 262100))
+ (const_int MAX_17BIT_OFFSET))
(const_int 8)
(ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
(const_int 24)