internal/cabi: support arch 386

This commit is contained in:
visualfc
2025-08-19 15:01:35 +08:00
parent 04bb3eb5a9
commit fd0b2ff72d
11 changed files with 294 additions and 77 deletions

View File

@@ -6,7 +6,7 @@ target triple = "wasm32-unknown-emscripten"
%struct.empty = type {}
; Function Attrs: noinline nounwind optnone
define hidden void @demo1() #0 {
define hidden void @demo0() #0 {
%1 = alloca %struct.empty, align 1
%2 = alloca %struct.empty, align 1
%3 = bitcast %struct.empty* %1 to i8*
@@ -18,6 +18,18 @@ define hidden void @demo1() #0 {
; Function Attrs: argmemonly nofree nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1
; Function Attrs: noinline nounwind optnone
define hidden void @demo1(i32 noundef %0) #0 {
%2 = alloca %struct.empty, align 1
%3 = alloca %struct.empty, align 1
%4 = alloca i32, align 4
store i32 %0, i32* %4, align 4
%5 = bitcast %struct.empty* %2 to i8*
%6 = bitcast %struct.empty* %3 to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %5, i8* align 1 %6, i32 0, i1 false)
ret void
}
; Function Attrs: noinline nounwind optnone
define hidden i32 @demo2(i32 noundef %0) #0 {
%2 = alloca %struct.empty, align 1