Author Topic: Align JUMPS and JCC  (Read 720 times)

Jokaste

  • Regular Member
  • *
  • Posts: 47
  • Never be pleased, always improve
    • Grincheux's Tools
Align JUMPS and JCC
« on: November 03, 2017, 01:32:48 AM »
In my programs the procedures are 16 bytes aligned.
Do I also have to align  the JMPs and the Jcond on a 16 bytes boundary?

Kenavo
---------------------------
Grincheux / Jokaste

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5777
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Align JUMPS and JCC
« Reply #1 on: November 03, 2017, 01:38:41 AM »
Nope !
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Align JUMPS and JCC
« Reply #2 on: November 04, 2017, 12:57:43 AM »
i think a lot depends on which processor is running the code

on my P4, short branch targets need not be aligned
but, it helps to align long targets

there are short and long (near) types of JMP's and Jcc's, only far JMP's
calls are either near or far, never short

Jokaste

  • Regular Member
  • *
  • Posts: 47
  • Never be pleased, always improve
    • Grincheux's Tools
Re: Align JUMPS and JCC
« Reply #3 on: November 04, 2017, 03:45:44 AM »
On my AMD it seems that when JMP and Jcc are aligned it is quicker.
It's easy to say, I have nothing to test.
Kenavo
---------------------------
Grincheux / Jokaste