1 ;; Machine description for T-Head vendor extensions
2 ;; Copyright (C) 2023-2024 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 3, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
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/>.
20 ;; XTheadMemPair: merge two SI or DI loads
22 [(set (match_operand:GPR 0 "register_operand" "")
23 (match_operand:GPR 1 "memory_operand" ""))
24 (set (match_operand:GPR 2 "register_operand" "")
25 (match_operand:GPR 3 "memory_operand" ""))]
27 && th_mempair_operands_p (operands, true, <GPR:MODE>mode)"
28 [(parallel [(set (match_dup 0) (match_dup 1))
29 (set (match_dup 2) (match_dup 3))])]
31 th_mempair_order_operands (operands, true, <GPR:MODE>mode);
34 ;; XTheadMemPair: merge two SI or DI stores
36 [(set (match_operand:GPR 0 "memory_operand" "")
37 (match_operand:GPR 1 "register_operand" ""))
38 (set (match_operand:GPR 2 "memory_operand" "")
39 (match_operand:GPR 3 "register_operand" ""))]
41 && th_mempair_operands_p (operands, false, <GPR:MODE>mode)"
42 [(parallel [(set (match_dup 0) (match_dup 1))
43 (set (match_dup 2) (match_dup 3))])]
45 th_mempair_order_operands (operands, false, <GPR:MODE>mode);
48 ;; XTheadMemPair: merge two SI loads with sign-extension
50 [(set (match_operand:DI 0 "register_operand" "")
51 (sign_extend:DI (match_operand:SI 1 "memory_operand" "")))
52 (set (match_operand:DI 2 "register_operand" "")
53 (sign_extend:DI (match_operand:SI 3 "memory_operand" "")))]
54 "TARGET_XTHEADMEMPAIR && TARGET_64BIT
55 && th_mempair_operands_p (operands, true, SImode)"
56 [(parallel [(set (match_dup 0) (sign_extend:DI (match_dup 1)))
57 (set (match_dup 2) (sign_extend:DI (match_dup 3)))])]
59 th_mempair_order_operands (operands, true, SImode);
62 ;; XTheadMemPair: merge two SI loads with zero-extension
64 [(set (match_operand:DI 0 "register_operand" "")
65 (zero_extend:DI (match_operand:SI 1 "memory_operand" "")))
66 (set (match_operand:DI 2 "register_operand" "")
67 (zero_extend:DI (match_operand:SI 3 "memory_operand" "")))]
68 "TARGET_XTHEADMEMPAIR && TARGET_64BIT
69 && th_mempair_operands_p (operands, true, SImode)"
70 [(parallel [(set (match_dup 0) (zero_extend:DI (match_dup 1)))
71 (set (match_dup 2) (zero_extend:DI (match_dup 3)))])]
73 th_mempair_order_operands (operands, true, SImode);