收藏切换
GCC Optimization for LoongArch Memory Accessing Instructions with Bound-Checking
收藏切换
Yanjun Shu1, Xiangyu Zheng1, Chenghua Xu2, 3, Pei Huang2, Yongqi Wang1, Fan Zhou1, Zhan Zhang1, Decheng Zuo1
Journal of Computer Research and Development | 2025, 62(5) : 1136 - 1150
Less
收藏切换
Journal of Computer Research and Development | 2025, 62(5): 1136-1150
• Computer Achitecture •
GCC Optimization for LoongArch Memory Accessing Instructions with Bound-Checking
Full
Yanjun Shu1, Xiangyu Zheng1, Chenghua Xu2, 3, Pei Huang2, Yongqi Wang1, Fan Zhou1, Zhan Zhang1, Decheng Zuo1
Affiliations
  • 1Faculty of Computing, Harbin Institute of Technology, Harbin 150001
  • 2Loongson Technology Corporation Limited, Beijing 100095
  • 3School of Computer Science and Technology, University of Science and Technology of China, Hefei 230026
  • born in 1981. PhD, associate professor. Member of CCF. Her main research interests include computer architecture, fault-tolerant computing, and high-performance computing

    born in 2001. Master candidate. His main research interests include computer architecture, and complier design and optimization

    born in 1989. PhD candidate. His main research interests include performance analysis of processor, and complier design and optimization

    born in 1983. Engineer. His main research interests include computer architecture and operating system

    born in 2001. Master candidate. His main research interests include performance analysis, operating system, and virtualization

    born in 2001. Undergraduate. His main research interests include computer architecture, operating system, and virtualization

    born in 1978. PhD, professor. Senior member of CCF. His main research interests include computer architecture, edge computing, and mobile computing

    born in 1972. PhD, professor. Senior member of CCF. His main research interests include computer architecture, fault-tolerant computing, and high-performance computing

About Author:

born in 1981. PhD, associate professor. Member of CCF. Her main research interests include computer architecture, fault-tolerant computing, and high-performance computing

born in 2001. Master candidate. His main research interests include computer architecture, and complier design and optimization

born in 1989. PhD candidate. His main research interests include performance analysis of processor, and complier design and optimization

born in 1983. Engineer. His main research interests include computer architecture and operating system

born in 2001. Master candidate. His main research interests include performance analysis, operating system, and virtualization

born in 2001. Undergraduate. His main research interests include computer architecture, operating system, and virtualization

born in 1978. PhD, professor. Senior member of CCF. His main research interests include computer architecture, edge computing, and mobile computing

born in 1972. PhD, professor. Senior member of CCF. His main research interests include computer architecture, fault-tolerant computing, and high-performance computing

Published: 2025-05-01 doi: 10.7544/issn1000-1239.202440100
Outline
收藏切换

LoongArch ISA (instruction set architecture) introduces new memory accessing instructions with bound-checking to decrease the overhead of memory security check. However, as a new type of memory accessing instruction, the existing GCC (GNU compiler collection) compiler tools cannot support it and thus LoongArch based hardware remains underutilized. Therefore, in this paper, we revise the GCC compiler with the LoongArch memory accessing instructions to optimize the memory security check. Specifically, our work is divided into three parts: 1) designing built-in functions for the memory accessing instructions; 2) improving the RTL (register transfer language) optimizer of GCC to recognize two kinds of semantic patterns of memory accessing instructions with bound-checking, which are non-exception handling and exception handling; 3) implementing a new exception signal SIGBCE for the bound check exception BCE that is raised by CPU in Linux kernel, and implementing the corresponding signal handling function in glibc (GNU C library) to deal with the bound check exception. The experiments on GCC 12.2.0 and Loongson 3C5000L server show that the revised compiler is able to correctly employ the new memory accessing instructions and bring an acceleration of approximately 20% in some security routines. Our work improves the ecosystem of LoongArch and boosts the development of LoongArch ISA. It will also be referential to GCC optimization for the specialized instructions.

compiler optimization  /  LoongArch  /  GCC  /  memory accessing with bound-checking  /  Loongson CPU  /  exception handling  /  memory security
舒燕君, 郑翔宇, 徐成华, 黄沛, 王永琪, 周凡, 张展, 左德承. 面向LoongArch边界检查访存指令的GCC优化. 计算机研究与发展, 2025 , 62 (5) : 1136 -1150 . DOI: 10.7544/issn1000-1239.202440100
Yanjun Shu, Xiangyu Zheng, Chenghua Xu, Pei Huang, Yongqi Wang, Fan Zhou, Zhan Zhang, Decheng Zuo. GCC Optimization for LoongArch Memory Accessing Instructions with Bound-Checking[J]. Journal of Computer Research and Development, 2025 , 62 (5) : 1136 -1150 . DOI: 10.7544/issn1000-1239.202440100
Year 2025 volume 62 Issue 5
128
58
Cite this Article
BibTeX
Article Info
doi: 10.7544/issn1000-1239.202440100
  • Receive Date:2024-02-21
  • Online Date:2026-11-10
  • Published:2025-05-01
Article Data
Affiliations
History
  • Received:2024-02-21
  • Revised:2024-08-12
  • Accepted:2024-09-03
Affiliations
    1Faculty of Computing, Harbin Institute of Technology, Harbin 150001
    2Loongson Technology Corporation Limited, Beijing 100095
    3School of Computer Science and Technology, University of Science and Technology of China, Hefei 230026
References
Share
https://castjournals.cast.org.cn/joweb/jsjyjyfz/EN/10.7544/issn1000-1239.202440100
Share to
QR

Scan QR to access full text

Cite this article
BibTeX
Citations
表12种不同金属材料的力学参数
科
Family
属数
Number of
genus
种数
Number of
species
占总种数比例
Percentage of
total species (%)
属
Genus
种数
Number of
species
占总种数比例
Percentage of total
species (%)
鹅膏菌科Amanitaceae 2 11 5.26 鹅膏菌属 Amanita 10 4.78
小菇科 Mycenaceae 2 12 5.74 丝盖伞属 Inocybe 5 2.39
多孔菌科 Polyporaceae 8 14 6.70 蜡蘑属 Laccaria 5 2.39
红菇科 Russulaceae 3 23 11.00 小皮伞属 Marasmius 6 2.87
小菇属 Mycena 11 5.26
光柄菇属 Pluteus 5 2.39
红菇属 Russula 17 8.13
栓菌属 Trametes 5 2.39
关闭全屏
  • BibTeX
  • EndNote
  • RefWorks
  • TxT