Skip to content

Instantly share code, notes, and snippets.

@nagisa
Created February 21, 2016 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nagisa/a9df2bf778e2583b1945 to your computer and use it in GitHub Desktop.
Save nagisa/a9df2bf778e2583b1945 to your computer and use it in GitHub Desktop.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
declare i32 @printf(i8*, ...) #1
; Function Attrs: nounwind
define i32 @main() #0 {
%x = alloca i128, align 4
%y = alloca i128, align 4
store i128 0, i128* %x
call void asm "", "rminsX,~{dirflag},~{fpsr},~{flags}"(i128* %x)
store i128 340282366920938463463374607431768211455, i128* %y
call void asm "", "rminsX,~{dirflag},~{fpsr},~{flags}"(i128* %y)
%1 = load i128, i128* %x, align 4
%2 = load i128, i128* %y, align 4
%3 = add i128 %1, %2
call void asm "", "rminsX,~{dirflag},~{fpsr},~{flags}"(i128 %3)
%4 = uitofp i128 %3 to float
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double %5)
ret i32 0
}
attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment