Commit 0c9ef7ad by Georg-Johann Lay Committed by Georg-Johann Lay

avr.c: Fix GNU coding rules and typos.

	* config/avr/avr.c: Fix GNU coding rules and typos.
	* config/avr/avr.h: Dito.
	* config/avr/avr-c.c: Dito.
	* config/avr/avr.md: Dito.

From-SVN: r216592
parent e650a568
2014-10-23 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c: Fix GNU coding rules and typos.
* config/avr/avr.h: Dito.
* config/avr/avr-c.c: Dito.
* config/avr/avr.md: Dito.
2014-10-23 Kirill Yukhin <kirill.yukhin@intel.com> 2014-10-23 Kirill Yukhin <kirill.yukhin@intel.com>
* config/i386/sse.md (define_mode_iterator VI1248_AVX512VL_AVX512BW): * config/i386/sse.md (define_mode_iterator VI1248_AVX512VL_AVX512BW):
...@@ -327,14 +327,14 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile) ...@@ -327,14 +327,14 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
cpp_define (pfile, "__AVR_TINY__"); cpp_define (pfile, "__AVR_TINY__");
/* Define macro "__AVR_TINY_PM_BASE_ADDRESS__" with mapped program memory /* Define macro "__AVR_TINY_PM_BASE_ADDRESS__" with mapped program memory
start address. This macro shall be referred where mapped program memory start address. This macro shall be used where mapped program
is accessed. (Eg. copying data section (do_copy_data) contents to data memory is accessed, eg. copying data section (__do_copy_data)
memory region. contents to data memory region.
NOTE: NOTE:
Program memory of AVR_TINY devices can not be accessed directly, it has Program memory of AVR_TINY devices cannot be accessed directly,
been mapped to the data memory. For AVR_TINY devices (ATtiny4/ 5/ 9/ 10/ it has been mapped to the data memory. For AVR_TINY devices
20 and 40) mapped program memory starts at 0x4000. (ATtiny4/5/9/10/20 and 40) mapped program memory starts at 0x4000. */
*/
cpp_define (pfile, "__AVR_TINY_PM_BASE_ADDRESS__=0x4000"); cpp_define (pfile, "__AVR_TINY_PM_BASE_ADDRESS__=0x4000");
} }
......
...@@ -91,8 +91,8 @@ FIXME: DRIVER_SELF_SPECS has changed. ...@@ -91,8 +91,8 @@ FIXME: DRIVER_SELF_SPECS has changed.
there is always __AVR_SP8__ == __AVR_HAVE_8BIT_SP__. */ there is always __AVR_SP8__ == __AVR_HAVE_8BIT_SP__. */
#define AVR_HAVE_8BIT_SP \ #define AVR_HAVE_8BIT_SP \
((avr_current_device->dev_attribute & AVR_SHORT_SP) || \ ((avr_current_device->dev_attribute & AVR_SHORT_SP) \
TARGET_TINY_STACK || avr_sp8) || TARGET_TINY_STACK || avr_sp8)
#define AVR_HAVE_SPH (!avr_sp8) #define AVR_HAVE_SPH (!avr_sp8)
...@@ -310,10 +310,10 @@ enum reg_class { ...@@ -310,10 +310,10 @@ enum reg_class {
#define STATIC_CHAIN_REGNUM ((AVR_TINY) ? 18 :2) #define STATIC_CHAIN_REGNUM ((AVR_TINY) ? 18 :2)
#define ELIMINABLE_REGS { \ #define ELIMINABLE_REGS { \
{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}} { FRAME_POINTER_REGNUM + 1, STACK_POINTER_REGNUM + 1 } }
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
OFFSET = avr_initial_elimination_offset (FROM, TO) OFFSET = avr_initial_elimination_offset (FROM, TO)
......
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
]) ])
(define_constants (define_constants
[ (TMP_REGNO_TINY 16) ; r16 is temp register for AVR_TINY [(TMP_REGNO_TINY 16) ; r16 is temp register for AVR_TINY
(ZERO_REGNO_TINY 17) ; r17 is zero register for AVR_TINY (ZERO_REGNO_TINY 17) ; r17 is zero register for AVR_TINY
]) ])
(define_c_enum "unspec" (define_c_enum "unspec"
...@@ -640,32 +640,31 @@ ...@@ -640,32 +640,31 @@
DONE; DONE;
} }
/* AVRTC-579 // AVRTC-579
if the source operand expression is out of range for 'lds' instruction // If the source operand expression is out of range for LDS instruction
copy source operand expression to register // copy source operand expression to register.
For tiny core, LDS instruction's memory access range limited to 0x40..0xbf // For tiny core, LDS instruction's memory access range limited to 0x40..0xbf.
*/
if (!tiny_valid_direct_memory_access_range(src,<MODE>mode)) if (!tiny_valid_direct_memory_access_range (src, <MODE>mode))
{ {
rtx srcx = XEXP(src,0); rtx srcx = XEXP (src, 0);
operands[1] = src = replace_equiv_address (src,copy_to_mode_reg (GET_MODE(srcx),srcx)); operands[1] = src = replace_equiv_address (src, copy_to_mode_reg (GET_MODE (srcx), srcx));
emit_move_insn(dest,src); emit_move_insn (dest, src);
DONE; DONE;
} }
/* AVRTC-579 // AVRTC-579
if the destination operand expression is out of range for 'sts' instruction // If the destination operand expression is out of range for STS instruction
copy destination operand expression to register // copy destination operand expression to register.
For tiny core, STS instruction's memory access range limited to 0x40..0xbf // For tiny core, STS instruction's memory access range limited to 0x40..0xbf.
*/
if (!tiny_valid_direct_memory_access_range(dest,<MODE>mode))
{
rtx destx = XEXP(dest,0);
operands[0] = dest = replace_equiv_address (dest,copy_to_mode_reg (GET_MODE(destx),destx));
emit_move_insn(dest,src);
DONE;
}
if (!tiny_valid_direct_memory_access_range (dest, <MODE>mode))
{
rtx destx = XEXP (dest, 0);
operands[0] = dest = replace_equiv_address (dest, copy_to_mode_reg (GET_MODE (destx), destx));
emit_move_insn (dest, src);
DONE;
}
}) })
;;======================================================================== ;;========================================================================
...@@ -683,12 +682,12 @@ ...@@ -683,12 +682,12 @@
[(set (match_operand:ALL1 0 "nonimmediate_operand" "=r ,d ,Qm ,r ,q,r,*r") [(set (match_operand:ALL1 0 "nonimmediate_operand" "=r ,d ,Qm ,r ,q,r,*r")
(match_operand:ALL1 1 "nox_general_operand" "r Y00,n Ynn,r Y00,Qm,r,q,i"))] (match_operand:ALL1 1 "nox_general_operand" "r Y00,n Ynn,r Y00,Qm,r,q,i"))]
"(register_operand (operands[0], <MODE>mode) "(register_operand (operands[0], <MODE>mode)
|| reg_or_0_operand (operands[1], <MODE>mode)) && || reg_or_0_operand (operands[1], <MODE>mode))
/* skip if operands are out of lds/sts memory access range(0x40..0xbf) /* Skip if operands are out of lds/sts memory access range(0x40..0xbf)
though access range is checked during define_expand, it is required though access range is checked during define_expand, it is required
here to avoid merging rtls during combine pass */ here to avoid merging RTXes during combine pass. */
tiny_valid_direct_memory_access_range(operands[0],QImode) && && tiny_valid_direct_memory_access_range (operands[0], QImode)
tiny_valid_direct_memory_access_range(operands[1],QImode)" && tiny_valid_direct_memory_access_range (operands[1], QImode)"
{ {
return output_movqi (insn, operands, NULL); return output_movqi (insn, operands, NULL);
} }
...@@ -782,12 +781,12 @@ ...@@ -782,12 +781,12 @@
[(set (match_operand:ALL2 0 "nonimmediate_operand" "=r,r ,r,m ,d,*r,q,r") [(set (match_operand:ALL2 0 "nonimmediate_operand" "=r,r ,r,m ,d,*r,q,r")
(match_operand:ALL2 1 "nox_general_operand" "r,Y00,m,r Y00,i,i ,r,q"))] (match_operand:ALL2 1 "nox_general_operand" "r,Y00,m,r Y00,i,i ,r,q"))]
"(register_operand (operands[0], <MODE>mode) "(register_operand (operands[0], <MODE>mode)
|| reg_or_0_operand (operands[1], <MODE>mode)) && || reg_or_0_operand (operands[1], <MODE>mode))
/* skip if operands are out of lds/sts memory access range(0x40..0xbf) /* Skip if operands are out of lds/sts memory access range(0x40..0xbf)
though access range is checked during define_expand, it is required though access range is checked during define_expand, it is required
here to avoid merging rtls during combine pass */ here to avoid merging RTXes during combine pass. */
tiny_valid_direct_memory_access_range(operands[0],HImode) && && tiny_valid_direct_memory_access_range (operands[0], HImode)
tiny_valid_direct_memory_access_range(operands[1],HImode)" && tiny_valid_direct_memory_access_range (operands[1], HImode)"
{ {
return output_movhi (insn, operands, NULL); return output_movhi (insn, operands, NULL);
} }
...@@ -936,12 +935,12 @@ ...@@ -936,12 +935,12 @@
[(set (match_operand:ALL4 0 "nonimmediate_operand" "=r,r ,r ,Qm ,!d,r") [(set (match_operand:ALL4 0 "nonimmediate_operand" "=r,r ,r ,Qm ,!d,r")
(match_operand:ALL4 1 "nox_general_operand" "r,Y00,Qm,r Y00,i ,i"))] (match_operand:ALL4 1 "nox_general_operand" "r,Y00,Qm,r Y00,i ,i"))]
"(register_operand (operands[0], <MODE>mode) "(register_operand (operands[0], <MODE>mode)
|| reg_or_0_operand (operands[1], <MODE>mode)) && || reg_or_0_operand (operands[1], <MODE>mode))
/* skip if operands are out of lds/sts memory access range(0x40..0xbf) /* Skip if operands are out of lds/sts memory access range(0x40..0xbf)
though access range is checked during define_expand, it is required though access range is checked during define_expand, it is required
here to avoid merging rtls during combine pass */ here to avoid merging RTXes during combine pass. */
tiny_valid_direct_memory_access_range(operands[0],SImode) && && tiny_valid_direct_memory_access_range (operands[0], SImode)
tiny_valid_direct_memory_access_range(operands[1],SImode)" && tiny_valid_direct_memory_access_range (operands[1], SImode)"
{ {
return output_movsisf (insn, operands, NULL); return output_movsisf (insn, operands, NULL);
} }
...@@ -956,12 +955,12 @@ ...@@ -956,12 +955,12 @@
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r ,Qm,!d,r") [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r ,Qm,!d,r")
(match_operand:SF 1 "nox_general_operand" "r,G,Qm,rG,F ,F"))] (match_operand:SF 1 "nox_general_operand" "r,G,Qm,rG,F ,F"))]
"(register_operand (operands[0], SFmode) "(register_operand (operands[0], SFmode)
|| reg_or_0_operand (operands[1], SFmode)) && || reg_or_0_operand (operands[1], SFmode))
/* skip if operands are out of lds/sts memory access range(0x40..0xbf) /* Skip if operands are out of lds/sts memory access range(0x40..0xbf)
though access range is checked during define_expand, it is required though access range is checked during define_expand, it is required
here to avoid merging rtls during combine pass */ here to avoid merging rtls during combine pass. */
tiny_valid_direct_memory_access_range(operands[0],SFmode) && && tiny_valid_direct_memory_access_range (operands[0], SFmode)
tiny_valid_direct_memory_access_range(operands[1],SFmode)" && tiny_valid_direct_memory_access_range (operands[1], SFmode)"
{ {
return output_movsisf (insn, operands, NULL); return output_movsisf (insn, operands, NULL);
} }
...@@ -2229,10 +2228,10 @@ ...@@ -2229,10 +2228,10 @@
DONE; DONE;
} }
/* For small constants we can do better by extending them on the fly. /* ; For small constants we can do better by extending them on the fly.
The constant can be loaded in one instruction and the widening ; The constant can be loaded in one instruction and the widening
multiplication is shorter. First try the unsigned variant because it ; multiplication is shorter. First try the unsigned variant because it
allows constraint "d" instead of "a" for the signed version. */ ; allows constraint "d" instead of "a" for the signed version. */
if (s9_operand (operands[2], HImode)) if (s9_operand (operands[2], HImode))
{ {
...@@ -3255,7 +3254,7 @@ ...@@ -3255,7 +3254,7 @@
swap %0\;lsl %0\;adc %0,__zero_reg__ swap %0\;lsl %0\;adc %0,__zero_reg__
swap %0\;lsl %0\;adc %0,__zero_reg__\;lsl %0\;adc %0,__zero_reg__ swap %0\;lsl %0\;adc %0,__zero_reg__\;lsl %0\;adc %0,__zero_reg__
bst %0,0\;ror %0\;bld %0,7 bst %0,0\;ror %0\;bld %0,7
" " ; empty
[(set_attr "length" "2,4,4,1,3,5,3,0") [(set_attr "length" "2,4,4,1,3,5,3,0")
(set_attr "cc" "set_n,set_n,clobber,none,set_n,set_n,clobber,none")]) (set_attr "cc" "set_n,set_n,clobber,none,set_n,set_n,clobber,none")])
...@@ -5059,7 +5058,7 @@ ...@@ -5059,7 +5058,7 @@
} }
else else
{ {
operands[7] = gen_rtx_PLUS (HImode, operands[6], operands[7] = gen_rtx_PLUS (HImode, operands[6],
gen_rtx_LABEL_REF (VOIDmode, operands[3])); gen_rtx_LABEL_REF (VOIDmode, operands[3]));
operands[8] = const0_rtx; operands[8] = const0_rtx;
operands[10] = operands[6]; operands[10] = operands[6];
...@@ -5611,7 +5610,7 @@ ...@@ -5611,7 +5610,7 @@
(clobber (match_scratch:QI 2 "=&d"))] (clobber (match_scratch:QI 2 "=&d"))]
"" ""
"ldi %2,lo8(%0) "ldi %2,lo8(%0)
1: dec %2 1: dec %2
brne 1b" brne 1b"
[(set_attr "length" "3") [(set_attr "length" "3")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
...@@ -5625,8 +5624,8 @@ ...@@ -5625,8 +5624,8 @@
(clobber (match_scratch:HI 2 "=&w,&d"))] (clobber (match_scratch:HI 2 "=&w,&d"))]
"" ""
"@ "@
ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\;1: sbiw %A2,1\;brne 1b ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\n1: sbiw %A2,1\;brne 1b
ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\;1: subi %A2,1\;sbci %B2,0\;brne 1b" ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\n1: subi %A2,1\;sbci %B2,0\;brne 1b"
[(set_attr "length" "4,5") [(set_attr "length" "4,5")
(set_attr "isa" "no_tiny,tiny") (set_attr "isa" "no_tiny,tiny")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
...@@ -5644,7 +5643,7 @@ ...@@ -5644,7 +5643,7 @@
"ldi %2,lo8(%0) "ldi %2,lo8(%0)
ldi %3,hi8(%0) ldi %3,hi8(%0)
ldi %4,hlo8(%0) ldi %4,hlo8(%0)
1: subi %2,1 1: subi %2,1
sbci %3,0 sbci %3,0
sbci %4,0 sbci %4,0
brne 1b" brne 1b"
...@@ -5666,7 +5665,7 @@ ...@@ -5666,7 +5665,7 @@
ldi %3,hi8(%0) ldi %3,hi8(%0)
ldi %4,hlo8(%0) ldi %4,hlo8(%0)
ldi %5,hhi8(%0) ldi %5,hhi8(%0)
1: subi %2,1 1: subi %2,1
sbci %3,0 sbci %3,0
sbci %4,0 sbci %4,0
sbci %5,0 sbci %5,0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment