본문 바로가기

instruction

The cost of inline functions The cost of inline functions [Posted April 28, 2004 by corbet] The kernel makes heavy use of inline functions. In many cases, inline expansion of functions is necessary; some of these functions employ various sorts of assembly language trickery that must be part of the calling function. In many other cases, though, inline functions are used as a way of improving performance. The thinking is that.. 더보기
compile 된 binary 가 thumb / thumb-2 인지 check 하기 오늘은 thumb-2 code 가 절 고민하게 만들었습니다. 아시다 시피 ARM 은 기본적으로 두가지 모드(arm code , thumb code) 를 지원합니다. arm 은 32bit instruction 이고 thumb 는 16 bit instruction 이지요. 헌데 thumb-2 와 thumbEE 라는 32 bit instruction 이 나와서 instruction 의 길이만으로 구별하기가 참 애매해 졌습니다. 단순하게 thumb 만으로만 build 된 경우 objdump 로 build 된 영역을 interpret 해 보면 thumb 인지 금방 알 수 있습니다. instruction 이 16bit 로 나오거든요.. thumb mode 로 빌드하려면 컴파일 시 다음 옵션을 추가하면 됩니다. -m.. 더보기
L1, L2 cache 와 I cache, D cache 의 관계 전에도 언급한 적이 있듯이 어떠한 instruction set 이나 data 를 읽어올때 부근에 있는 data 들을 cache 로 저장합니다. 이때 L1 cache 를 사용하게 되며 L1 cache 에 없는 내용은 L2 cache 에서 뒤지게 됩니다. L2 cache 에도 없으면 Ram 에서 해당 데이터와 주변의 값들을 읽어오는 것이지요. I cache 는 instruction 이고 D cache 는 data cache 를 말합니다. L1 은 I cache 와 D cache 를 모두 가지고 있으며, L2 는 자주 access 가 이루어 지는 D cache 만으로 이루어져 있습니다. ==> 실제 확인해 본 결과 (Havard Archithecture 의 프로세서에서) L2 cache 에 Data와 Inst.. 더보기