This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Regarding Bitwise relaxation for H8/300


Hi,

**************************** begin blink.c *******************************************
volatile unsigned char ch=1;
int main(void)
{
	ch =105;
	ch |= 0x40;
    return 0 ;
}
******************************** end blink.c ******************************************

Above code is compiled with following command,
h8300-elf-gcc -ms -ms2600 -nostartfiles -mrelax -o blink.out blink.c 

Objdump of blink.out is,
******************************************************************************
blink.out:     file format elf32-h8300
Disassembly of section .text:
00000100 <_main>:
 100:	01 00 6d f6 	01 00 6d f6       		mov.l	er6,@-er7
 104:	0f f6       	0f f6             		mov.l	er7,er6
 106:	fa 69       	fa 69             		mov.b	#0x69,r2l
 108:	6a 8a 01 20 	6a 8a 01 20       		mov.b	r2l,@0x120:16
 10c:	6a 38 00 00 	6a 38 00 00 01 20 70 60 	bset	#0x6,@0x120:32
 110:	01 20 70 60 
 114:	19 22       	19 22             		sub.w	r2,r2
 116:	0d 20       	0d 20             		mov.w	r2,r0
 118:	01 00 6d 76 	01 00 6d 76       		mov.l	@er7+,er6
 11c:	54 70       	54 70             		rts
**************************************************************************************

Above objdump clearly shows that "bset #0x6,@0x120:32" insn can be relaxed to
"bset	#0x6,@0x120:16" likewise "mov.b r2l,@0x120:16" is relaxed by linker from insn 
"mov.b r2l,@0x120:32".

I would like to add relaxation support for bitwise insn like bset, bclr etc . 
Can anyone guide me on this ?

Regards,
Anil Paranjpe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]