comparison gcc/config/m32c/blkmov.md @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 ;; Machine Descriptions for R8C/M16C/M32C 1 ;; Machine Descriptions for R8C/M16C/M32C
2 ;; Copyright (C) 2006-2018 Free Software Foundation, Inc. 2 ;; Copyright (C) 2006-2020 Free Software Foundation, Inc.
3 ;; Contributed by Red Hat. 3 ;; Contributed by Red Hat.
4 ;; 4 ;;
5 ;; This file is part of GCC. 5 ;; This file is part of GCC.
6 ;; 6 ;;
7 ;; GCC is free software; you can redistribute it and/or modify it 7 ;; GCC is free software; you can redistribute it and/or modify it
38 38
39 ;; 0 = destination (mem:BLK ...) 39 ;; 0 = destination (mem:BLK ...)
40 ;; 1 = source (mem:BLK ...) 40 ;; 1 = source (mem:BLK ...)
41 ;; 2 = count 41 ;; 2 = count
42 ;; 3 = alignment 42 ;; 3 = alignment
43 (define_expand "movmemhi" 43 (define_expand "cpymemhi"
44 [(match_operand 0 "ap_operand" "") 44 [(match_operand 0 "ap_operand" "")
45 (match_operand 1 "ap_operand" "") 45 (match_operand 1 "ap_operand" "")
46 (match_operand 2 "m32c_r3_operand" "") 46 (match_operand 2 "m32c_r3_operand" "")
47 (match_operand 3 "" "") 47 (match_operand 3 "" "")
48 ] 48 ]
49 "" 49 ""
50 "if (m32c_expand_movmemhi(operands)) DONE; FAIL;" 50 "if (m32c_expand_cpymemhi(operands)) DONE; FAIL;"
51 ) 51 )
52 52
53 ;; We can't use mode iterators for these because M16C uses r1h to extend 53 ;; We can't use mode iterators for these because M16C uses r1h to extend
54 ;; the source address, for copying data from ROM to RAM. We don't yet 54 ;; the source address, for copying data from ROM to RAM. We don't yet
55 ;; support that, but we need to zero our r1h, so the patterns differ. 55 ;; support that, but we need to zero our r1h, so the patterns differ.
58 ;; 1 = src (out) 58 ;; 1 = src (out)
59 ;; 2 = count (out) 59 ;; 2 = count (out)
60 ;; 3 = dest (in) 60 ;; 3 = dest (in)
61 ;; 4 = src (in) 61 ;; 4 = src (in)
62 ;; 5 = count (in) 62 ;; 5 = count (in)
63 (define_insn "movmemhi_bhi_op" 63 (define_insn "cpymemhi_bhi_op"
64 [(set (mem:QI (match_operand:HI 3 "ap_operand" "0")) 64 [(set (mem:QI (match_operand:HI 3 "ap_operand" "0"))
65 (mem:QI (match_operand:HI 4 "ap_operand" "1"))) 65 (mem:QI (match_operand:HI 4 "ap_operand" "1")))
66 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w") 66 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w")
67 (const_int 0)) 67 (const_int 0))
68 (set (match_operand:HI 0 "ap_operand" "=Ra1") 68 (set (match_operand:HI 0 "ap_operand" "=Ra1")
73 (zero_extend:HI (match_dup 5)))) 73 (zero_extend:HI (match_dup 5))))
74 (use (reg:HI R1_REGNO))] 74 (use (reg:HI R1_REGNO))]
75 "TARGET_A16" 75 "TARGET_A16"
76 "mov.b:q\t#0,r1h\n\tsmovf.b\t; %0[0..%2-1]=r1h%1[]" 76 "mov.b:q\t#0,r1h\n\tsmovf.b\t; %0[0..%2-1]=r1h%1[]"
77 ) 77 )
78 (define_insn "movmemhi_bpsi_op" 78 (define_insn "cpymemhi_bpsi_op"
79 [(set (mem:QI (match_operand:PSI 3 "ap_operand" "0")) 79 [(set (mem:QI (match_operand:PSI 3 "ap_operand" "0"))
80 (mem:QI (match_operand:PSI 4 "ap_operand" "1"))) 80 (mem:QI (match_operand:PSI 4 "ap_operand" "1")))
81 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w") 81 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w")
82 (const_int 0)) 82 (const_int 0))
83 (set (match_operand:PSI 0 "ap_operand" "=Ra1") 83 (set (match_operand:PSI 0 "ap_operand" "=Ra1")
87 (plus:PSI (match_dup 4) 87 (plus:PSI (match_dup 4)
88 (zero_extend:PSI (match_dup 5))))] 88 (zero_extend:PSI (match_dup 5))))]
89 "TARGET_A24" 89 "TARGET_A24"
90 "smovf.b\t; %0[0..%2-1]=%1[]" 90 "smovf.b\t; %0[0..%2-1]=%1[]"
91 ) 91 )
92 (define_insn "movmemhi_whi_op" 92 (define_insn "cpymemhi_whi_op"
93 [(set (mem:HI (match_operand:HI 3 "ap_operand" "0")) 93 [(set (mem:HI (match_operand:HI 3 "ap_operand" "0"))
94 (mem:HI (match_operand:HI 4 "ap_operand" "1"))) 94 (mem:HI (match_operand:HI 4 "ap_operand" "1")))
95 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w") 95 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w")
96 (const_int 0)) 96 (const_int 0))
97 (set (match_operand:HI 0 "ap_operand" "=Ra1") 97 (set (match_operand:HI 0 "ap_operand" "=Ra1")
102 (zero_extend:HI (match_dup 5)))) 102 (zero_extend:HI (match_dup 5))))
103 (use (reg:HI R1_REGNO))] 103 (use (reg:HI R1_REGNO))]
104 "TARGET_A16" 104 "TARGET_A16"
105 "mov.b:q\t#0,r1h\n\tsmovf.w\t; %0[0..%2-1]=r1h%1[]" 105 "mov.b:q\t#0,r1h\n\tsmovf.w\t; %0[0..%2-1]=r1h%1[]"
106 ) 106 )
107 (define_insn "movmemhi_wpsi_op" 107 (define_insn "cpymemhi_wpsi_op"
108 [(set (mem:HI (match_operand:PSI 3 "ap_operand" "0")) 108 [(set (mem:HI (match_operand:PSI 3 "ap_operand" "0"))
109 (mem:HI (match_operand:PSI 4 "ap_operand" "1"))) 109 (mem:HI (match_operand:PSI 4 "ap_operand" "1")))
110 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w") 110 (set (match_operand:HI 2 "m32c_r3_operand" "=R3w")
111 (const_int 0)) 111 (const_int 0))
112 (set (match_operand:PSI 0 "ap_operand" "=Ra1") 112 (set (match_operand:PSI 0 "ap_operand" "=Ra1")