comparison gcc/config/avr/avr.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 description for GNU compiler, 1 ;; Machine description for GNU compiler,
2 ;; for ATMEL AVR micro controllers. 2 ;; for ATMEL AVR micro controllers.
3 ;; Copyright (C) 1998-2018 Free Software Foundation, Inc. 3 ;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
4 ;; Contributed by Denis Chertykov (chertykov@gmail.com) 4 ;; Contributed by Denis Chertykov (chertykov@gmail.com)
5 5
6 ;; This file is part of GCC. 6 ;; This file is part of GCC.
7 7
8 ;; GCC is free software; you can redistribute it and/or modify 8 ;; GCC is free software; you can redistribute it and/or modify
68 (ZERO_REGNO_TINY 17) ; r17 is zero register for AVR_TINY 68 (ZERO_REGNO_TINY 17) ; r17 is zero register for AVR_TINY
69 ]) 69 ])
70 70
71 (define_c_enum "unspec" 71 (define_c_enum "unspec"
72 [UNSPEC_STRLEN 72 [UNSPEC_STRLEN
73 UNSPEC_MOVMEM 73 UNSPEC_CPYMEM
74 UNSPEC_INDEX_JMP 74 UNSPEC_INDEX_JMP
75 UNSPEC_FMUL 75 UNSPEC_FMUL
76 UNSPEC_FMULS 76 UNSPEC_FMULS
77 UNSPEC_FMULSU 77 UNSPEC_FMULSU
78 UNSPEC_COPYSIGN 78 UNSPEC_COPYSIGN
156 (define_attr "adjust_len" 156 (define_attr "adjust_len"
157 "out_bitop, plus, addto_sp, sext, 157 "out_bitop, plus, addto_sp, sext,
158 tsthi, tstpsi, tstsi, compare, compare64, call, 158 tsthi, tstpsi, tstsi, compare, compare64, call,
159 mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32, 159 mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32,
160 ufract, sfract, round, 160 ufract, sfract, round,
161 xload, movmem, 161 xload, cpymem,
162 ashlqi, ashrqi, lshrqi, 162 ashlqi, ashrqi, lshrqi,
163 ashlhi, ashrhi, lshrhi, 163 ashlhi, ashrhi, lshrhi,
164 ashlsi, ashrsi, lshrsi, 164 ashlsi, ashrsi, lshrsi,
165 ashlpsi, ashrpsi, lshrpsi, 165 ashlpsi, ashrpsi, lshrpsi,
166 insert_bits, insv_notbit, insv_notbit_0, insv_notbit_7, 166 insert_bits, insv_notbit, insv_notbit_0, insv_notbit_7,
342 emit_clobber (hard_frame_pointer_rtx); 342 emit_clobber (hard_frame_pointer_rtx);
343 DONE; 343 DONE;
344 }) 344 })
345 345
346 346
347 ;; Defining nonlocal_goto_receiver means we must also define this. 347 ;; Defining nonlocal_goto_receiver means we must also define this
348 ;; even though its function is identical to that in builtins.c 348 ;; even though its function is identical to that in builtins.c
349 349
350 (define_expand "nonlocal_goto" 350 (define_expand "nonlocal_goto"
351 [(use (match_operand 0 "general_operand")) 351 [(use (match_operand 0 "general_operand"))
352 (use (match_operand 1 "general_operand")) 352 (use (match_operand 1 "general_operand"))
397 [CQI 397 [CQI
398 HI CHI HA UHA HQ UHQ 398 HI CHI HA UHA HQ UHQ
399 SI CSI SA USA SQ USQ 399 SI CSI SA USA SQ USQ
400 DI CDI DA UDA DQ UDQ 400 DI CDI DA UDA DQ UDQ
401 TA UTA 401 TA UTA
402 SF SC 402 SF DF SC DC
403 PSI]) 403 PSI])
404 404
405 (define_expand "push<mode>1" 405 (define_expand "push<mode>1"
406 [(match_operand:MPUSH 0 "" "")] 406 [(match_operand:MPUSH 0 "" "")]
407 "" 407 ""
990 (set_attr "cc" "clobber")]) 990 (set_attr "cc" "clobber")])
991 991
992 ;;========================================================================= 992 ;;=========================================================================
993 ;; move string (like memcpy) 993 ;; move string (like memcpy)
994 994
995 (define_expand "movmemhi" 995 (define_expand "cpymemhi"
996 [(parallel [(set (match_operand:BLK 0 "memory_operand" "") 996 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
997 (match_operand:BLK 1 "memory_operand" "")) 997 (match_operand:BLK 1 "memory_operand" ""))
998 (use (match_operand:HI 2 "const_int_operand" "")) 998 (use (match_operand:HI 2 "const_int_operand" ""))
999 (use (match_operand:HI 3 "const_int_operand" ""))])] 999 (use (match_operand:HI 3 "const_int_operand" ""))])]
1000 "" 1000 ""
1001 { 1001 {
1002 if (avr_emit_movmemhi (operands)) 1002 if (avr_emit_cpymemhi (operands))
1003 DONE; 1003 DONE;
1004 1004
1005 FAIL; 1005 FAIL;
1006 }) 1006 })
1007 1007
1008 (define_mode_attr MOVMEM_r_d [(QI "r") 1008 (define_mode_attr CPYMEM_r_d [(QI "r")
1009 (HI "wd")]) 1009 (HI "wd")])
1010 1010
1011 ;; $0 : Address Space 1011 ;; $0 : Address Space
1012 ;; $1, $2 : Loop register 1012 ;; $1, $2 : Loop register
1013 ;; R30 : source address 1013 ;; R30 : source address
1014 ;; R26 : destination address 1014 ;; R26 : destination address
1015 1015
1016 ;; "movmem_qi" 1016 ;; "cpymem_qi"
1017 ;; "movmem_hi" 1017 ;; "cpymem_hi"
1018 (define_insn "movmem_<mode>" 1018 (define_insn "cpymem_<mode>"
1019 [(set (mem:BLK (reg:HI REG_X)) 1019 [(set (mem:BLK (reg:HI REG_X))
1020 (mem:BLK (reg:HI REG_Z))) 1020 (mem:BLK (reg:HI REG_Z)))
1021 (unspec [(match_operand:QI 0 "const_int_operand" "n")] 1021 (unspec [(match_operand:QI 0 "const_int_operand" "n")]
1022 UNSPEC_MOVMEM) 1022 UNSPEC_CPYMEM)
1023 (use (match_operand:QIHI 1 "register_operand" "<MOVMEM_r_d>")) 1023 (use (match_operand:QIHI 1 "register_operand" "<CPYMEM_r_d>"))
1024 (clobber (reg:HI REG_X)) 1024 (clobber (reg:HI REG_X))
1025 (clobber (reg:HI REG_Z)) 1025 (clobber (reg:HI REG_Z))
1026 (clobber (reg:QI LPM_REGNO)) 1026 (clobber (reg:QI LPM_REGNO))
1027 (clobber (match_operand:QIHI 2 "register_operand" "=1"))] 1027 (clobber (match_operand:QIHI 2 "register_operand" "=1"))]
1028 "" 1028 ""
1029 { 1029 {
1030 return avr_out_movmem (insn, operands, NULL); 1030 return avr_out_cpymem (insn, operands, NULL);
1031 } 1031 }
1032 [(set_attr "adjust_len" "movmem") 1032 [(set_attr "adjust_len" "cpymem")
1033 (set_attr "cc" "clobber")]) 1033 (set_attr "cc" "clobber")])
1034 1034
1035 1035
1036 ;; $0 : Address Space 1036 ;; $0 : Address Space
1037 ;; $1 : RAMPZ RAM address 1037 ;; $1 : RAMPZ RAM address
1038 ;; R24 : #bytes and loop register 1038 ;; R24 : #bytes and loop register
1039 ;; R23:Z : 24-bit source address 1039 ;; R23:Z : 24-bit source address
1040 ;; R26 : 16-bit destination address 1040 ;; R26 : 16-bit destination address
1041 1041
1042 ;; "movmemx_qi" 1042 ;; "cpymemx_qi"
1043 ;; "movmemx_hi" 1043 ;; "cpymemx_hi"
1044 (define_insn "movmemx_<mode>" 1044 (define_insn "cpymemx_<mode>"
1045 [(set (mem:BLK (reg:HI REG_X)) 1045 [(set (mem:BLK (reg:HI REG_X))
1046 (mem:BLK (lo_sum:PSI (reg:QI 23) 1046 (mem:BLK (lo_sum:PSI (reg:QI 23)
1047 (reg:HI REG_Z)))) 1047 (reg:HI REG_Z))))
1048 (unspec [(match_operand:QI 0 "const_int_operand" "n")] 1048 (unspec [(match_operand:QI 0 "const_int_operand" "n")]
1049 UNSPEC_MOVMEM) 1049 UNSPEC_CPYMEM)
1050 (use (reg:QIHI 24)) 1050 (use (reg:QIHI 24))
1051 (clobber (reg:HI REG_X)) 1051 (clobber (reg:HI REG_X))
1052 (clobber (reg:HI REG_Z)) 1052 (clobber (reg:HI REG_Z))
1053 (clobber (reg:QI LPM_REGNO)) 1053 (clobber (reg:QI LPM_REGNO))
1054 (clobber (reg:HI 24)) 1054 (clobber (reg:HI 24))