CISC에서 RISC로: 언어 모델로 안내된 어셈블리 변환
From CISC to RISC: language-model guided assembly transpilation
November 25, 2024
저자: Ahmed Heakl, Chaimaa Abi, Rania Hossam, Abdulrahman Mahmoud
cs.AI
초록
x86에서 ARM 아키텍처로의 전환은 주로 ARM의 에너지 효율성과 전통적인 분야에서의 성능 향상으로 주도되어 다양한 영역에서 점점 더 일반적으로 이루어지고 있습니다. 그러나 이 ISA 전환은 주로 x86 소프트웨어의 방대한 레거시 생태계와 프로프라이어터리 생태계 및 소프트웨어 스택 간의 이식성 부족으로 인해 중대한 도전을 제기합니다. 본 논문은 CRT를 소개하는데, 이는 가벼운 LLM 기반 트랜스파일러로 x86 어셈블리를 ARM 어셈블리로 자동 변환합니다. 저희의 방법론은 x86의 CISC 기반과 ARM의 RISC 기반 컴퓨팅 패러다임 사이의 근본적인 아키텍처적 격차를 극복하면서 프로그램 의미론을 보존하고 성능을 최적화합니다. 저희는 다양한 실제 응용 프로그램에서 CRT를 평가하였으며, 포괄적인 테스트 스위트에서 x86에서 ARMv5로의 79.25% 번역 정확도와 x86에서 RISC-V로의 88.68% 정확도를 달성하였습니다. Apple M2 하드웨어 (ARMv8)에서의 실제 배포에서, 저희의 트랜스파일된 코드는 Apple의 Rosetta 2 가상화 엔진 대비 1.73배의 가속을 달성하면서 2.41배의 메모리 효율성과 1.47배의 더 나은 에너지 소비를 제공합니다. 테스트와 분석을 통해, CRT가 CISC/RISC 분할을 성공적으로 탐험하고 기계 "언어" 장벽에도 불구하고 올바르게 실행 가능한 RISC 코드를 생성함을 보여줍니다. 저희는 코드, 모델, 훈련 데이터셋 및 벤치마크를 다음 링크에서 공개합니다: https://ahmedheakl.github.io/asm2asm/.
English
The transition from x86 to ARM architecture is becoming increasingly common
across various domains, primarily driven by ARM's energy efficiency and
improved performance across traditional sectors. However, this ISA shift poses
significant challenges, mainly due to the extensive legacy ecosystem of x86
software and lack of portability across proprietary ecosystems and software
stacks. This paper introduces CRT, a lightweight LLM-based transpiler that
automatically converts x86 assembly to ARM assembly. Our approach bridges the
fundamental architectural gap between x86's CISC-based and ARM's RISC-based
computing paradigms while preserving program semantics and optimizing
performance. We evaluate CRT on diverse real-world applications, achieving
79.25% translation accuracy from x86 to ARMv5 on our comprehensive test suite,
and an 88.68% accuracy from x86 to RISC-V. In practical deployments on Apple M2
hardware (ARMv8), our transpiled code achieves 1.73times speedup compared to
Apple's Rosetta 2 virtualization engine, while delivering 2.41times memory
efficiency and 1.47times better energy consumption. Through testing and
analysis, we show that CRT successfully navigates the CISC/RISC divide and
generates correctly executable RISC code despite machine ``language'' barriers.
We release our code, models, training datasets, and benchmarks at:
https://ahmedheakl.github.io/asm2asm/.Summary
AI-Generated Summary