Andes Workshop

It is currently Thu Mar 28, 2024 8:34 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Turn off relax optimization
PostPosted: Thu Jun 12, 2014 3:42 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
Turn off relax optimization
Linker Option: -mno-relax
Attachment:
-mno-relax.png
-mno-relax.png [ 45.39 KiB | Viewed 7443 times ]


nds32le-elf-gcc -O0 -nostartfiles -static -mno-relax -Toutput/.nds32le-elf-mculib-v3_start0x0.x -Xlinker -defsym -Xlinker _stack=0x1000 -o "mem_test2.adx" ./src/mem_test2.o

Attachment:
mem_test2.zip [58.29 KiB]
Downloaded 765 times


No relax:
Code:
00000000 <main>:
   0:   46 01 23 45    sethi $r0,#0x12345
   4:   58 00 06 78    ori $r0,$r0,#0x678
   8:   46 f0 00 00    sethi $r15,#0x0
   c:   14 07 80 1a    swi $r0,[$r15+#0x68]
  10:   46 f0 00 00    sethi $r15,#0x0
  14:   04 07 80 1a    lwi $r0,[$r15+#0x68]
  18:   46 f0 00 00    sethi $r15,#0x0
  1c:   14 07 80 1c    swi $r0,[$r15+#0x70]
  20:   46 08 76 54    sethi $r0,#0x87654
  24:   58 00 03 21    ori $r0,$r0,#0x321
  28:   46 f0 00 00    sethi $r15,#0x0
  2c:   14 07 80 1b    swi $r0,[$r15+#0x6c]
  30:   46 f0 00 00    sethi $r15,#0x0
  34:   04 07 80 1b    lwi $r0,[$r15+#0x6c]
  38:   46 f0 00 00    sethi $r15,#0x0
  3c:   14 07 80 1c    swi $r0,[$r15+#0x70]
  40:   d5 e0          j8 0 <main>


If you us the relax function

Code:
00000000 <main>:
   0:   46 01 23 45    sethi $r0,#0x12345
   4:   58 00 06 78    ori $r0,$r0,#0x678
   8:   3c 0f ff fe    swi.gp $r0,[+#-8]
   c:   3c 0d ff fe    lwi.gp $r0,[+#-8]
  10:   3c 0e 00 00    swi.gp $r0,[+#0]
  14:   46 08 76 54    sethi $r0,#0x87654
  18:   58 00 03 21    ori $r0,$r0,#0x321
  1c:   3c 0f ff ff    swi.gp $r0,[+#-4]
  20:   3c 0d ff ff    lwi.gp $r0,[+#-4]
  24:   3c 0e 00 00    swi.gp $r0,[+#0]
  28:   d5 ec          j8 0 <main>



Sample code:
Attachment:
mem_test2.zip [58.29 KiB]
Downloaded 765 times


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group