관리 메뉴

juniverse

[RISC-V] Pseudo Instruction 본문

컴퓨터구조 computer organization and design/RISC-V edition

[RISC-V] Pseudo Instruction

iamjunis 2022. 7. 21. 00:57
반응형
SMALL

pseudo 명령어는 CPU가 모르는 쉽게 말하면 '가짜 명령어'이다.

이는 컴파일러가 컴파일 과정에서 실제 명령어로 바꿔준다.

기능 Pseudo 명령어 실제 명령어
Load abdolute address la rd, symbol auipc rd, ...
addi rd, rd, ...
Load immediate li rd, immediate lui rd, ...
addi rd, ...
No operation nop addi x0, x0, 0
Copy register mv rd, rs addi rd, rs, 0
One's complement not rd, rs xori rd, rs, -1
Two's complement neg rd, rs sub rd, x0, rs
Branch if >, signed  bgt rs, rt, offset blt rs, rt, offset
Branch if ≤, signed ble rs, rt, offset bge rs, rt, offset
Branch if >, unsigned bgtu rs, rt, offset bltu rs, rt, offset
Branch if ≤, unsigned bleu rs, rt, offset bgeu rs, rt, offset
Jump j offset jal x0, offset
Jump and link jal offset jal x1, offset
Jump register jr  rs jalr x0, 0(rs)
Jump and link register jalr rs jalr x1, 0(rs)
Return from function ret jalr x0, 0(x1)
Call function call offset auipc x1, offset[31:12] + offset[11]
jalr x1, offset[11:0](x1)

 

# Reference
원리부터 설계까지 쉽고 명확한 컴퓨터구조 RISC-V 중심으로 - 서태원 지음 - 도서출판 홍릉
반응형
LIST