1 ;; builtin definitions for DEC VAX.
2 ;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify it under
7 ;; the terms of the GNU General Public License as published by the Free
8 ;; Software Foundation; either version 3, or (at your option) any later
11 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
22 (VUNSPEC_LOCK 100) ; sync lock and test
23 (VUNSPEC_UNLOCK 101) ; sync lock release
27 (define_expand "ffssi2"
28 [(set (match_operand:SI 0 "nonimmediate_operand" "")
29 (ffs:SI (match_operand:SI 1 "general_operand" "")))]
33 rtx label = gen_label_rtx ();
34 emit_insn (gen_ffssi2_internal (operands[0], operands[1]));
35 emit_jump_insn (gen_bne (label));
36 emit_insn (gen_negsi2 (operands[0], const1_rtx));
38 emit_insn (gen_addsi3 (operands[0], operands[0], const1_rtx));
42 (define_insn "ffssi2_internal"
43 [(set (match_operand:SI 0 "nonimmediate_operand" "=rQ")
44 (ffs:SI (match_operand:SI 1 "general_operand" "nrmT")))
45 (set (cc0) (match_dup 0))]
49 (define_expand "sync_lock_test_and_set<mode>"
50 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=&g")
51 (unspec:VAXint [(match_operand:VAXint 1 "memory_operand" "+m")
52 (match_operand:VAXint 2 "const_int_operand" "n")
59 if (operands[2] != const1_rtx)
62 label = gen_label_rtx ();
63 emit_move_insn (operands[0], const1_rtx);
64 emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label, operands[1]));
65 emit_move_insn (operands[0], const0_rtx);
70 (define_insn "jbbssiqi"
74 (ne (zero_extract:SI (match_operand:QI 0 "memory_operand" "g")
76 (match_operand:SI 1 "general_operand" "nrm"))
78 (label_ref (match_operand 2 "" ""))
80 (set (zero_extract:SI (match_operand:QI 3 "memory_operand" "+0")
87 (define_insn "jbbssihi"
91 (ne (zero_extract:SI (match_operand:HI 0 "memory_operand" "Q")
93 (match_operand:SI 1 "general_operand" "nrm"))
95 (label_ref (match_operand 2 "" ""))
97 (set (zero_extract:SI (match_operand:HI 3 "memory_operand" "+0")
104 (define_insn "jbbssisi"
108 (ne (zero_extract:SI (match_operand:SI 0 "memory_operand" "Q")
110 (match_operand:SI 1 "general_operand" "nrm"))
112 (label_ref (match_operand 2 "" ""))
114 (set (zero_extract:SI (match_operand:SI 3 "memory_operand" "+0")
122 (define_expand "sync_lock_release<mode>"
123 [(set (match_operand:VAXint 0 "memory_operand" "+m")
124 (unspec:VAXint [(match_operand:VAXint 1 "const_int_operand" "n")
130 if (operands[1] != const0_rtx)
133 label = gen_label_rtx ();
134 emit_jump_insn (gen_jbbcci<mode> (operands[0], const0_rtx, label, operands[0]));
137 emit_move_insn (operands[0], const0_rtx);
142 (define_insn "jbbcciqi"
146 (eq (zero_extract:SI (match_operand:QI 0 "memory_operand" "g")
148 (match_operand:SI 1 "general_operand" "nrm"))
150 (label_ref (match_operand 2 "" ""))
152 (set (zero_extract:SI (match_operand:QI 3 "memory_operand" "+0")
159 (define_insn "jbbccihi"
163 (eq (zero_extract:SI (match_operand:HI 0 "memory_operand" "Q")
165 (match_operand:SI 1 "general_operand" "nrm"))
167 (label_ref (match_operand 2 "" ""))
169 (set (zero_extract:SI (match_operand:HI 3 "memory_operand" "+0")
176 (define_insn "jbbccisi"
180 (eq (zero_extract:SI (match_operand:SI 0 "memory_operand" "Q")
182 (match_operand:SI 1 "general_operand" "nrm"))
184 (label_ref (match_operand 2 "" ""))
186 (set (zero_extract:SI (match_operand:SI 3 "memory_operand" "+0")