1 ; RUN: opt < %s -instcombine -mtriple=x86_64-apple-macosx -S | FileCheck %s
2 target triple = "x86_64-apple-macosx"
4 define double @test1(double %a, double %b) nounwind {
5 %wa = fpext double %a to x86_fp80
6 %wb = fpext double %b to x86_fp80
7 %wr = fadd x86_fp80 %wa, %wb
8 %r = fptrunc x86_fp80 %wr to double
11 ; CHECK: fadd x86_fp80
15 define double @test2(double %a, double %b) nounwind {
16 %wa = fpext double %a to x86_fp80
17 %wb = fpext double %b to x86_fp80
18 %wr = fsub x86_fp80 %wa, %wb
19 %r = fptrunc x86_fp80 %wr to double
22 ; CHECK: fsub x86_fp80
26 define double @test3(double %a, double %b) nounwind {
27 %wa = fpext double %a to x86_fp80
28 %wb = fpext double %b to x86_fp80
29 %wr = fmul x86_fp80 %wa, %wb
30 %r = fptrunc x86_fp80 %wr to double
33 ; CHECK: fmul x86_fp80
37 define double @test4(double %a, half %b) nounwind {
38 %wa = fpext double %a to x86_fp80
39 %wb = fpext half %b to x86_fp80
40 %wr = fmul x86_fp80 %wa, %wb
41 %r = fptrunc x86_fp80 %wr to double
48 define double @test5(double %a, double %b) nounwind {
49 %wa = fpext double %a to x86_fp80
50 %wb = fpext double %b to x86_fp80
51 %wr = fdiv x86_fp80 %wa, %wb
52 %r = fptrunc x86_fp80 %wr to double
55 ; CHECK: fdiv x86_fp80