Skip to content

Commit cc62025

Browse files
author
git apple-llvm automerger
committed
Merge commit 'aea5399919ad' from llvm.org/main into next
2 parents 09080c5 + aea5399 commit cc62025

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ HexagonTargetLowering::initializeHVXLowering() {
359359
setCondCodeAction(ISD::SETULE, MVT::v64f16, Expand);
360360
setCondCodeAction(ISD::SETUGE, MVT::v64f16, Expand);
361361
setCondCodeAction(ISD::SETULT, MVT::v64f16, Expand);
362+
setCondCodeAction(ISD::SETUO, MVT::v64f16, Expand);
363+
setCondCodeAction(ISD::SETO, MVT::v64f16, Expand);
362364

363365
setCondCodeAction(ISD::SETNE, MVT::v32f32, Expand);
364366
setCondCodeAction(ISD::SETLE, MVT::v32f32, Expand);
@@ -372,6 +374,8 @@ HexagonTargetLowering::initializeHVXLowering() {
372374
setCondCodeAction(ISD::SETULE, MVT::v32f32, Expand);
373375
setCondCodeAction(ISD::SETUGE, MVT::v32f32, Expand);
374376
setCondCodeAction(ISD::SETULT, MVT::v32f32, Expand);
377+
setCondCodeAction(ISD::SETUO, MVT::v32f32, Expand);
378+
setCondCodeAction(ISD::SETO, MVT::v32f32, Expand);
375379

376380
// Boolean vectors.
377381

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
;; RUN: llc --mtriple=hexagon -mattr=+hvxv79,+hvx-length128b %s -o - | FileCheck %s
2+
3+
define dso_local void @store_isnan_f32(ptr %a, ptr %b, ptr %isnan_cmp) local_unnamed_addr {
4+
entry:
5+
%arrayidx_a = getelementptr inbounds nuw float, ptr %a, i32 0
6+
%arrayidx_b = getelementptr inbounds nuw float, ptr %b, i32 0
7+
%0 = load <32 x float>, ptr %arrayidx_a, align 4
8+
%1 = load <32 x float>, ptr %arrayidx_b, align 4
9+
%.vectorized = fcmp uno <32 x float> %0, %1
10+
%.LS.instance = zext <32 x i1> %.vectorized to <32 x i32>
11+
%arrayidx1 = getelementptr inbounds nuw i32, ptr %isnan_cmp, i32 0
12+
store <32 x i32> %.LS.instance, ptr %arrayidx1, align 4
13+
ret void
14+
}
15+
16+
; CHECK: store_isnan_f32
17+
; CHECK: [[RONE32:r[0-9]+]] = #1
18+
; CHECK: [[VOP2_F32:v[0-9]+]] = vxor([[VOP2_F32]],[[VOP2_F32]])
19+
; CHECK: [[VOP1_F32:v[0-9]+]] = vmemu(r0+#0)
20+
; CHECK: [[VONES32:v[0-9]+]] = vsplat([[RONE32]])
21+
; CHECK: [[Q1_F32:q[0-9]+]] = vcmp.eq([[VOP1_F32]].w,[[VOP1_F32]].w)
22+
; CHECK: [[VOP3_F32:v[0-9]+]] = vmemu(r1+#0)
23+
; CHECK: [[Q1_F32]] &= vcmp.eq([[VOP3_F32]].w,[[VOP3_F32]].w)
24+
; CHECK: [[VOUT_F32:v[0-9]+]] = vmux([[Q1_F32]],[[VOP2_F32]],[[VONES32]])
25+
; CHECK: vmemu(r2+#0) = [[VOUT_F32]]
26+
27+
define dso_local void @store_isnan_f16(ptr %a, ptr %b, ptr %isnan_cmp) local_unnamed_addr {
28+
entry:
29+
%arrayidx_a = getelementptr inbounds nuw half, ptr %a, i32 0
30+
%arrayidx_b = getelementptr inbounds nuw half, ptr %b, i32 0
31+
%0 = load <64 x half>, ptr %arrayidx_a, align 2
32+
%1 = load <64 x half>, ptr %arrayidx_b, align 2
33+
%.vectorized = fcmp uno <64 x half> %0, %1
34+
%conv.LS.instance = zext <64 x i1> %.vectorized to <64 x i16>
35+
%arrayidx1 = getelementptr inbounds nuw i16, ptr %isnan_cmp, i32 0
36+
store <64 x i16> %conv.LS.instance, ptr %arrayidx1, align 2
37+
ret void
38+
}
39+
; CHECK-LABEL: store_isnan_f16
40+
; CHECK: [[RONE16:r[0-9]+]] = #1
41+
; CHECK: [[VOP2_F16:v[0-9]+]] = vxor([[VOP2_F16]],[[VOP2_F16]])
42+
; CHECK: [[VOP1_F16:v[0-9]+]] = vmemu(r0+#0)
43+
; CHECK: [[VONES16:v[0-9]+]].h = vsplat([[RONE16]])
44+
; CHECK: [[Q1_F16:q[0-9]+]] = vcmp.eq([[VOP1_F16]].h,[[VOP1_F16]].h)
45+
; CHECK: [[VOP3_F16:v[0-9]+]] = vmemu(r1+#0)
46+
; CHECK: [[Q1_F16]] &= vcmp.eq([[VOP3_F16]].h,[[VOP3_F16]].h)
47+
; CHECK: [[VOUT_F16:v[0-9]+]] = vmux([[Q1_F16]],[[VOP2_F16]],[[VONES16]])
48+
; CHECK: vmemu(r2+#0) = [[VOUT_F32]]
49+
50+
define dso_local void @store_isordered_f32(ptr %a, ptr %b, ptr %isordered_cmp) local_unnamed_addr {
51+
entry:
52+
%arrayidx_a = getelementptr inbounds nuw float, ptr %a, i32 0
53+
%arrayidx_b = getelementptr inbounds nuw float, ptr %b, i32 0
54+
%0 = load <32 x float>, ptr %arrayidx_a, align 4
55+
%1 = load <32 x float>, ptr %arrayidx_b, align 4
56+
%.vectorized = fcmp ord <32 x float> %0, %1
57+
%.LS.instance = zext <32 x i1> %.vectorized to <32 x i32>
58+
%arrayidx1 = getelementptr inbounds nuw i32, ptr %isordered_cmp, i32 0
59+
store <32 x i32> %.LS.instance, ptr %arrayidx1, align 4
60+
ret void
61+
}
62+
; CHECK-LABEL: store_isordered_f32
63+
; CHECK: [[VOP2_ORD_F32:v[0-9]+]] = vxor([[VOP2_ORD_F32]],[[VOP2_ORD_F32]])
64+
; CHECK: [[VOP1_ORD_F32:v[0-9]+]] = vmemu(r0+#0)
65+
; CHECK: [[VONES_ORD_F32:v[0-9]+]] = vsplat([[RONE32]])
66+
; CHECK: [[Q1_ORD_F32:q[0-9]+]] = vcmp.eq([[VOP1_ORD_F32]].w,[[VOP1_ORD_F32]].w)
67+
; CHECK: [[VOP3_ORD_F32:v[0-9]+]] = vmemu(r1+#0)
68+
; CHECK: [[Q1_ORD_F32]] &= vcmp.eq([[VOP3_ORD_F32]].w,[[VOP3_ORD_F32]].w)
69+
; CHECK: [[VOUT_ORD_F32:v[0-9]+]] = vmux([[Q1_ORD_F32]],[[VONES_ORD_F32]],[[VOP2_ORD_F32]])
70+
; CHECK: vmemu(r2+#0) = [[VOUT_ORD_F32]]
71+
72+
73+
define dso_local void @store_isordered_f16(ptr %a, ptr %b, ptr %isordered_cmp) local_unnamed_addr {
74+
entry:
75+
%arrayidx_a = getelementptr inbounds nuw half, ptr %a, i32 0
76+
%arrayidx_b = getelementptr inbounds nuw half, ptr %b, i32 0
77+
%0 = load <64 x half>, ptr %arrayidx_a, align 2
78+
%1 = load <64 x half>, ptr %arrayidx_b, align 2
79+
%.vectorized = fcmp ord <64 x half> %0, %1
80+
%conv.LS.instance = zext <64 x i1> %.vectorized to <64 x i16>
81+
%arrayidx1 = getelementptr inbounds nuw i16, ptr %isordered_cmp, i32 0
82+
store <64 x i16> %conv.LS.instance, ptr %arrayidx1, align 2
83+
ret void
84+
}
85+
; CHECK-LABEL: store_isordered_f16
86+
; CHECK: [[VOP2_ORD_F16:v[0-9]+]] = vxor([[VOP2_ORD_F16]],[[VOP2_ORD_F16]])
87+
; CHECK: [[VOP1_ORD_F16:v[0-9]+]] = vmemu(r0+#0)
88+
; CHECK: [[VONES_ORD_F16:v[0-9]+]].h = vsplat([[RONE16]])
89+
; CHECK: [[Q1_ORD_F16:q[0-9]+]] = vcmp.eq([[VOP1_ORD_F16]].h,[[VOP1_ORD_F16]].h)
90+
; CHECK: [[VOP3_ORD_F16:v[0-9]+]] = vmemu(r1+#0)
91+
; CHECK: [[Q1_ORD_F16]] &= vcmp.eq([[VOP3_ORD_F16]].h,[[VOP3_ORD_F16]].h)
92+
; CHECK: [[VOUT_ORD_F16:v[0-9]+]] = vmux([[Q1_ORD_F16]],[[VONES_ORD_F16]],[[VOP2_ORD_F16]])
93+
; CHECK: vmemu(r2+#0) = [[VOUT_ORD_F16]]

0 commit comments

Comments
 (0)