1 ; Check that 0.0 is not materialized for CSEL when comparing against it. 2 3 ; RUN: llc -mtriple=aarch64-linux-gnu -o - < %s | FileCheck %s 4 5 define float @foeq(float %a, float %b) #0 { 6 %t = fcmp oeq float %a, 0.0 7 %v = select i1 %t, float 0.0, float %b 8 ret float %v 9 ; CHECK-LABEL: foeq 10 ; CHECK: fcmp [[R:s[0-9]+]], #0.0 11 ; CHECK-NEXT: fcsel {{s[0-9]+}}, [[R]], {{s[0-9]+}}, eq 12 } 13 14 define float @fueq(float %a, float %b) #0 { 15 %t = fcmp ueq float %a, 0.0 16 %v = select i1 %t, float 0.0, float %b 17 ret float %v 18 ; CHECK-LABEL: fueq 19 ; CHECK: fcmp [[R:s[0-9]+]], #0.0 20 ; CHECK-NEXT: fcsel {{s[0-9]+}}, [[R]], {{s[0-9]+}}, eq 21 ; CHECK-NEXT: fcsel {{s[0-9]+}}, [[R]], {{s[0-9]+}}, vs 22 } 23 24 define float @fone(float %a, float %b) #0 { 25 %t = fcmp one float %a, 0.0 26 %v = select i1 %t, float %b, float 0.0 27 ret float %v 28 ; CHECK-LABEL: fone 29 ; CHECK: fcmp [[R:s[0-9]+]], #0.0 30 ; CHECK-NEXT: fcsel {{s[0-9]+}}, {{s[0-9]+}}, [[R]], mi 31 ; CHECK-NEXT: fcsel {{s[0-9]+}}, {{s[0-9]+}}, [[R]], gt 32 } 33 34 define float @fune(float %a, float %b) #0 { 35 %t = fcmp une float %a, 0.0 36 %v = select i1 %t, float %b, float 0.0 37 ret float %v 38 ; CHECK-LABEL: fune 39 ; CHECK: fcmp [[R:s[0-9]+]], #0.0 40 ; CHECK-NEXT: fcsel {{s[0-9]+}}, {{s[0-9]+}}, [[R]], ne 41 } 42 43 define double @doeq(double %a, double %b) #0 { 44 %t = fcmp oeq double %a, 0.0 45 %v = select i1 %t, double 0.0, double %b 46 ret double %v 47 ; CHECK-LABEL: doeq 48 ; CHECK: fcmp [[R:d[0-9]+]], #0.0 49 ; CHECK-NEXT: fcsel {{d[0-9]+}}, [[R]], {{d[0-9]+}}, eq 50 } 51 52 define double @dueq(double %a, double %b) #0 { 53 %t = fcmp ueq double %a, 0.0 54 %v = select i1 %t, double 0.0, double %b 55 ret double %v 56 ; CHECK-LABEL: dueq 57 ; CHECK: fcmp [[R:d[0-9]+]], #0.0 58 ; CHECK-NEXT: fcsel {{d[0-9]+}}, [[R]], {{d[0-9]+}}, eq 59 ; CHECK-NEXT: fcsel {{d[0-9]+}}, [[R]], {{d[0-9]+}}, vs 60 } 61 62 define double @done(double %a, double %b) #0 { 63 %t = fcmp one double %a, 0.0 64 %v = select i1 %t, double %b, double 0.0 65 ret double %v 66 ; CHECK-LABEL: done 67 ; CHECK: fcmp [[R:d[0-9]+]], #0.0 68 ; CHECK-NEXT: fcsel {{d[0-9]+}}, {{d[0-9]+}}, [[R]], mi 69 ; CHECK-NEXT: fcsel {{d[0-9]+}}, {{d[0-9]+}}, [[R]], gt 70 } 71 72 define double @dune(double %a, double %b) #0 { 73 %t = fcmp une double %a, 0.0 74 %v = select i1 %t, double %b, double 0.0 75 ret double %v 76 ; CHECK-LABEL: dune 77 ; CHECK: fcmp [[R:d[0-9]+]], #0.0 78 ; CHECK-NEXT: fcsel {{d[0-9]+}}, {{d[0-9]+}}, [[R]], ne 79 } 80 81 attributes #0 = { nounwind "unsafe-fp-math"="true" } 82 83