Skip to content

Commit 6588982

Browse files
kaushik-quicincfhossein-quic
authored andcommitted
[Hexagon] Support lowering of setuo & seto for vector types in Hexagon
Resolves instruction selection failure for v64f16 and v32f32 vector types. Patch by: Fateme Hosseini
1 parent dbc96f4 commit 6588982

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ HexagonTargetLowering::initializeHVXLowering() {
355355
setCondCodeAction(ISD::SETULE, MVT::v64f16, Expand);
356356
setCondCodeAction(ISD::SETUGE, MVT::v64f16, Expand);
357357
setCondCodeAction(ISD::SETULT, MVT::v64f16, Expand);
358+
setCondCodeAction(ISD::SETUO, MVT::v64f16, Expand);
359+
setCondCodeAction(ISD::SETO, MVT::v64f16, Expand);
358360

359361
setCondCodeAction(ISD::SETNE, MVT::v32f32, Expand);
360362
setCondCodeAction(ISD::SETLE, MVT::v32f32, Expand);
@@ -368,6 +370,8 @@ HexagonTargetLowering::initializeHVXLowering() {
368370
setCondCodeAction(ISD::SETULE, MVT::v32f32, Expand);
369371
setCondCodeAction(ISD::SETUGE, MVT::v32f32, Expand);
370372
setCondCodeAction(ISD::SETULT, MVT::v32f32, Expand);
373+
setCondCodeAction(ISD::SETUO, MVT::v32f32, Expand);
374+
setCondCodeAction(ISD::SETO, MVT::v32f32, Expand);
371375

372376
// Boolean vectors.
373377

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 %isnan_a) local_unnamed_addr {
4+
entry:
5+
%arrayidx = getelementptr inbounds nuw float, ptr %a, i32 0
6+
%0 = load <32 x float>, ptr %arrayidx, align 4
7+
%.vectorized = fcmp uno <32 x float> %0, zeroinitializer
8+
%.LS.instance = zext <32 x i1> %.vectorized to <32 x i32>
9+
%arrayidx1 = getelementptr inbounds nuw i32, ptr %isnan_a, i32 0
10+
store <32 x i32> %.LS.instance, ptr %arrayidx1, align 4
11+
ret void
12+
}
13+
;; CHECK: store_isnan_f32
14+
;; CHECK: vcmp.eq({{v[0-9]+.w}},{{v[0-9]+.w}})
15+
16+
define dso_local void @store_isnan_f16(ptr %a, ptr %isnan_a) local_unnamed_addr {
17+
entry:
18+
%arrayidx = getelementptr inbounds nuw half, ptr %a, i32 0
19+
%0 = load <64 x half>, ptr %arrayidx, align 2
20+
%.vectorized = fcmp uno <64 x half> %0, zeroinitializer
21+
%conv.LS.instance = zext <64 x i1> %.vectorized to <64 x i16>
22+
%arrayidx1 = getelementptr inbounds nuw i16, ptr %isnan_a, i32 0
23+
store <64 x i16> %conv.LS.instance, ptr %arrayidx1, align 2
24+
ret void
25+
}
26+
27+
;; CHECK: store_isnan_f16
28+
;; CHECK: vcmp.eq({{v[0-9]+.h}},{{v[0-9]+.h}})

0 commit comments

Comments
 (0)