Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction

The code samples in Table 1 described in this document demonstrate the functions of each tool of the Kunpeng DevKit. You can refer to these code samples when analyzing and optimizing your development projects in the Kunpeng DevKit.

Table 1 Code samples

Feature

Working Mode

Scenario

Description

Code Sample

Source code porting

WebUI

Sample 1: Source Code Scan

The Kunpeng Porting Advisor scans the C/C++/Fortran/assembly source code of the x86 platform software. It identifies the SO dependency in the source code, scans the code lines that need to be modified, and provides modification suggestions. It calculates the estimated workload based on the code modification efficiency set by the system, for the leadership to make project decisions based on the estimation. This function is under the first-level menu Source Code Porting. It is available in both the x86 and Kunpeng environments.

NOTE:

Do not rescan the assembly source code after porting and modification. A rescan may cause inaccurate analysis results.

Makefile

file_lock.c

file_lock.h

ksw.c

ksw.h

interface.s

WebUI

Sample 2: Inline Assembly Translation (single-instruction and multi-instruction conversions)

The tool supports the inline assembly function of the assembly translation module. This sample explains how to scan the C/C++ source code of x86-based software, identifies the inline assembly code in the source code, and provides suggestions for adapting the inline assembly code to the Kunpeng platform.

swap.c

gcd.c

WebUI

Sample 3: Full Assembly Translation

The tool supports the full assembly function of the assembly translation module. This sample explains how to scan the source code of x86-based software, identifies the full assembly code in the source code, and provides suggestions for adapting the full assembly code to the Kunpeng platform.

test.s

Makefile

main.c