double produce(void);
void consume(unsigned char);
void myEntry(void)
{
consume((unsigned char)produce());
}
; ModuleID = '/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c'
source_filename = "/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 {
%1 = call double @produce()
%2 = fptoui double %1 to i8
call void @consume(i8 zeroext %2)
ret void
}
declare dso_local void @consume(i8 zeroext) #1
declare dso_local double @produce() #1
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"Debian clang version 11.0.1-2"}
; ModuleID = '/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c'
source_filename = "/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 !dbg !9 {
%1 = call double @produce(), !dbg !13
%2 = fptoui double %1 to i8, !dbg !14
call void @consume(i8 zeroext %2), !dbg !15
ret void, !dbg !16
}
declare dso_local void @consume(i8 zeroext) #1
declare dso_local double @produce() #1
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!5, !6, !7}
!llvm.ident = !{!8}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "Debian clang version 11.0.1-2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c", directory: "/__w/semicompiled/semicompiled")
!2 = !{}
!3 = !{!4}
!4 = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char)
!5 = !{i32 7, !"Dwarf Version", i32 4}
!6 = !{i32 2, !"Debug Info Version", i32 3}
!7 = !{i32 1, !"wchar_size", i32 4}
!8 = !{!"Debian clang version 11.0.1-2"}
!9 = distinct !DISubprogram(name: "myEntry", scope: !10, file: !10, line: 3, type: !11, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!10 = !DIFile(filename: "/tmp/semicompiled-XsnJGMYj-10RS44Bd-unsigned_char-double-7734558843936530144/source.c", directory: "")
!11 = !DISubroutineType(types: !12)
!12 = !{null}
!13 = !DILocation(line: 5, column: 28, scope: !9)
!14 = !DILocation(line: 5, column: 13, scope: !9)
!15 = !DILocation(line: 5, column: 5, scope: !9)
!16 = !DILocation(line: 6, column: 1, scope: !9)
(module
(type (;0;) (func))
(type (;1;) (func (param i32)))
(type (;2;) (func (result f64)))
(import "env" "produce" (func (;0;) (type 2)))
(import "env" "consume" (func (;1;) (type 1)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "__table_base" (global (;2;) i32))
(import "env" "memory" (memory (;0;) 0))
(import "env" "__indirect_function_table" (table (;0;) 0 funcref))
(func (;2;) (type 0)
call 3)
(func (;3;) (type 0))
(func (;4;) (type 0)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 f64 f64 f64)
call 0
local.set 10
f64.const 0x1p+32 (;=4.29497e+09;)
local.set 11
local.get 10
local.get 11
f64.lt
local.set 0
f64.const 0x0p+0 (;=0;)
local.set 12
local.get 10
local.get 12
f64.ge
local.set 1
local.get 0
local.get 1
i32.and
local.set 2
local.get 2
i32.eqz
local.set 3
block ;; label = @1
block ;; label = @2
local.get 3
br_if 0 (;@2;)
local.get 10
i32.trunc_f64_u
local.set 4
local.get 4
local.set 5
br 1 (;@1;)
end
i32.const 0
local.set 6
local.get 6
local.set 5
end
local.get 5
local.set 7
i32.const 255
local.set 8
local.get 7
local.get 8
i32.and
local.set 9
local.get 9
call 1
return)
(global (;3;) i32 (i32.const 0))
(export "__post_instantiate" (func 2))
(export "__wasm_apply_relocs" (func 3))
(export "myEntry" (func 4))
(export "__dso_handle" (global 3)))
eBPF doesn't natively support float conversion.
Join the thriving social scene at github.com/andrewbaxter/semicompiled.