Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: Cortex-M3 Branch instruction encoding? - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cortex-M3 Branch instruction encoding? Missing definitions in the ARMv7-M Ref for the T3 encoding format Rate Topic: -----

#1 User is offline   cfbsoftware 

  • Member
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 06-May 10

Posted 11 June 2012 - 12:55 AM

In the process of implementing the Cortex-M3 code generator for our Astrobe Oberon compiler I was unable to find a definition for the calculation of 'imm32' in the T3 Encoding version of the 32-bit conditional branch instruction (see Section A7.7.12 of ARMv7-M Architecture Reference Manual, ARM DDI 0403D)

Experiments indicate that the J1 and J2 bits are not used and the definition is:

imm32 = SignExtend(S:imm6:imm11:’0’, 32);

Is that correct?

This post has been edited by cfbsoftware: 11 June 2012 - 12:56 AM

Chris Burrows
CFB Software
http://www.astrobe.com
0

#2 User is offline   sim 

  • Regular Contributor
  • PipPipPip
  • Group: Members.
  • Posts: 419
  • Joined: 04-October 06

Posted 11 June 2012 - 08:12 AM

I believe it's meant to be: imm32 = SignExtend(S:J2:J1:imm6:imm11:'0', 32);

hth
s.
0

#3 User is offline   cfbsoftware 

  • Member
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 06-May 10

Posted 11 June 2012 - 11:33 AM

Yes - you are right. I Googled your version of the statement and found that it was actually present in earlier revisions of the manual.

Also, with the benefit of hindsight, the note in the latest manual that the range of allowed offsets for encoding T3 is -1048576 to 1048574 clearly shows that it must be a 21-bit number so the J1 and J2 bits must be used.

Thank you very much for helping to solve that puzzle for me,

Chris.
Chris Burrows
CFB Software
http://www.astrobe.com
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic