Why should I know this?

ARM STP instruction 본문

Study

ARM STP instruction

die4taoam 2024. 3. 18. 21:26

원문 출처 : https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions/STP--Store-Pair-of-Registers-?lang=en#iclass_post_index

 

Documentation – Arm Developer

 

developer.arm.com

 

STP

레지스터 쌍 저장은 기본 레지스터 값과 즉시 오프셋에서 주소를 계산하고 두 개의 레지스터에서 계산된 주소에 32비트 단어 2개 또는 64비트 이중 단어 2개를 저장합니다. 메모리 액세스에 대한 자세한 내용은 로드/저장 주소 지정 모드를 참조하세요.

 

It has encodings from 3 classes: Post-index , Pre-index and Signed offset

 

Common

32-bit (opc == 00)

STP <Wt1>, <Wt2>, [<Xn|SP>{, #<imm>}]

64-bit (opc == 10)

STP <Xt1>, <Xt2>, [<Xn|SP>{, #<imm>}]

 

Post-Index

boolean wback = TRUE;
boolean postindex = TRUE;

 

Pre-Index

boolean wback = TRUE;
boolean postindex = FALSE;

 

Signed offset

boolean wback = FALSE;
boolean postindex = FALSE;

 

wback, postindex 는 다음처럼 사용된다.

if n == 31 then
    CheckSPAlignment();
    address = SP[];
else
    address = X[n, 64];

if !postindex then
   address = GenerateAddress(address, offset, accdesc);

... 

if wback then
    if postindex then
        address = GenerateAddress(address, offset, accdesc);
    if n == 31 then
        SP[] = address;
    else
        X[n, 64] = address;

 

postindex == FALSE

  address = address+offset (offset 계산은 언제나처럼  (register size * imm))

 

wback == TRUE

  postindex == TRUE,

    address = address + offset

  n==31(sp)

    sp = address

  else

    X[n, 64] = address

 

postindex는 메모리 적재까지의 과정을 모두 마무리하고 주소의 재 계산에 들어가는데, 이 과정에서 변경되는 것은 오직 accdesc이다.

IsFeatureImplemented(FEAT_LSE2)

위 기능이 활성화 되었을 경우

accdesc.ispair = TRUE;

로 활성화 되는데, 이걸로 어떤 변화가 생기는지는 모르겠다.

 

 

'Study' 카테고리의 다른 글

SuperOptimization Study  (0) 2023.08.28
superoptimization - 모음  (0) 2023.07.21
프로그램 분석 분류  (0) 2023.05.19
Program Analysis (??)  (0) 2023.05.18
백업 - Nodejs Uftrace  (0) 2023.03.13
Comments