Skip to content

Commit f731d25

Browse files
AlexMacleanIanWood1
authored andcommitted
[DAGCombiner] Fold and/or of NaN SETCC - tests follow up (llvm#136168)
Follow up to llvm#135645 to address test cleanup review.
1 parent d09c257 commit f731d25

File tree

2 files changed

+120
-2
lines changed

2 files changed

+120
-2
lines changed

llvm/test/CodeGen/NVPTX/and-or-setcc.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2-
; RUN: llc < %s -mtriple=nvptx64 | FileCheck %s
3-
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 | %ptxas-verify %}
2+
; RUN: llc < %s | FileCheck %s
3+
; RUN: %if ptxas %{ llc < %s | %ptxas-verify %}
44

55
target triple = "nvptx64-nvidia-cuda"
66

llvm/test/CodeGen/X86/and-or-setcc.ll

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,121 @@ define i1 @or_uno(float %a, float %b) {
5555
%e = or i1 %c, %d
5656
ret i1 %e
5757
}
58+
59+
define <4 x i1> @and_ord_vec(<4 x float> %a, <4 x float> %b) {
60+
; X86-LABEL: and_ord_vec:
61+
; X86: # %bb.0:
62+
; X86-NEXT: pushl %eax
63+
; X86-NEXT: .cfi_def_cfa_offset 8
64+
; X86-NEXT: flds {{[0-9]+}}(%esp)
65+
; X86-NEXT: fstps (%esp) # 4-byte Folded Spill
66+
; X86-NEXT: flds {{[0-9]+}}(%esp)
67+
; X86-NEXT: flds {{[0-9]+}}(%esp)
68+
; X86-NEXT: flds {{[0-9]+}}(%esp)
69+
; X86-NEXT: flds {{[0-9]+}}(%esp)
70+
; X86-NEXT: flds {{[0-9]+}}(%esp)
71+
; X86-NEXT: flds {{[0-9]+}}(%esp)
72+
; X86-NEXT: flds {{[0-9]+}}(%esp)
73+
; X86-NEXT: fucompp
74+
; X86-NEXT: fnstsw %ax
75+
; X86-NEXT: fucompp
76+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
77+
; X86-NEXT: sahf
78+
; X86-NEXT: fnstsw %ax
79+
; X86-NEXT: fucompp
80+
; X86-NEXT: setnp %dh
81+
; X86-NEXT: shlb $2, %dh
82+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
83+
; X86-NEXT: sahf
84+
; X86-NEXT: fnstsw %ax
85+
; X86-NEXT: flds (%esp) # 4-byte Folded Reload
86+
; X86-NEXT: fxch %st(1)
87+
; X86-NEXT: fucompp
88+
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
89+
; X86-NEXT: setnp %dl
90+
; X86-NEXT: shlb $3, %dl
91+
; X86-NEXT: orb %dh, %dl
92+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
93+
; X86-NEXT: sahf
94+
; X86-NEXT: setnp %dh
95+
; X86-NEXT: fnstsw %ax
96+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
97+
; X86-NEXT: sahf
98+
; X86-NEXT: setnp %al
99+
; X86-NEXT: addb %al, %al
100+
; X86-NEXT: orb %dh, %al
101+
; X86-NEXT: orb %dl, %al
102+
; X86-NEXT: movb %al, (%ecx)
103+
; X86-NEXT: movl %ecx, %eax
104+
; X86-NEXT: popl %ecx
105+
; X86-NEXT: .cfi_def_cfa_offset 4
106+
; X86-NEXT: retl $4
107+
;
108+
; X64-LABEL: and_ord_vec:
109+
; X64: # %bb.0:
110+
; X64-NEXT: cmpordps %xmm1, %xmm0
111+
; X64-NEXT: retq
112+
%c = fcmp ord <4 x float> %a, %a
113+
%d = fcmp ord <4 x float> %b, %b
114+
%e = and <4 x i1> %c, %d
115+
ret <4 x i1> %e
116+
}
117+
118+
define <4 x i1> @or_uno_vec(<4 x float> %a, <4 x float> %b) {
119+
; X86-LABEL: or_uno_vec:
120+
; X86: # %bb.0:
121+
; X86-NEXT: pushl %eax
122+
; X86-NEXT: .cfi_def_cfa_offset 8
123+
; X86-NEXT: flds {{[0-9]+}}(%esp)
124+
; X86-NEXT: fstps (%esp) # 4-byte Folded Spill
125+
; X86-NEXT: flds {{[0-9]+}}(%esp)
126+
; X86-NEXT: flds {{[0-9]+}}(%esp)
127+
; X86-NEXT: flds {{[0-9]+}}(%esp)
128+
; X86-NEXT: flds {{[0-9]+}}(%esp)
129+
; X86-NEXT: flds {{[0-9]+}}(%esp)
130+
; X86-NEXT: flds {{[0-9]+}}(%esp)
131+
; X86-NEXT: flds {{[0-9]+}}(%esp)
132+
; X86-NEXT: fucompp
133+
; X86-NEXT: fnstsw %ax
134+
; X86-NEXT: fucompp
135+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
136+
; X86-NEXT: sahf
137+
; X86-NEXT: fnstsw %ax
138+
; X86-NEXT: fucompp
139+
; X86-NEXT: setp %dh
140+
; X86-NEXT: shlb $2, %dh
141+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
142+
; X86-NEXT: sahf
143+
; X86-NEXT: fnstsw %ax
144+
; X86-NEXT: flds (%esp) # 4-byte Folded Reload
145+
; X86-NEXT: fxch %st(1)
146+
; X86-NEXT: fucompp
147+
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
148+
; X86-NEXT: setp %dl
149+
; X86-NEXT: shlb $3, %dl
150+
; X86-NEXT: orb %dh, %dl
151+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
152+
; X86-NEXT: sahf
153+
; X86-NEXT: setp %dh
154+
; X86-NEXT: fnstsw %ax
155+
; X86-NEXT: # kill: def $ah killed $ah killed $ax
156+
; X86-NEXT: sahf
157+
; X86-NEXT: setp %al
158+
; X86-NEXT: addb %al, %al
159+
; X86-NEXT: orb %dh, %al
160+
; X86-NEXT: orb %dl, %al
161+
; X86-NEXT: movb %al, (%ecx)
162+
; X86-NEXT: movl %ecx, %eax
163+
; X86-NEXT: popl %ecx
164+
; X86-NEXT: .cfi_def_cfa_offset 4
165+
; X86-NEXT: retl $4
166+
;
167+
; X64-LABEL: or_uno_vec:
168+
; X64: # %bb.0:
169+
; X64-NEXT: cmpunordps %xmm1, %xmm0
170+
; X64-NEXT: retq
171+
%c = fcmp uno <4 x float> %a, %a
172+
%d = fcmp uno <4 x float> %b, %b
173+
%e = or <4 x i1> %c, %d
174+
ret <4 x i1> %e
175+
}

0 commit comments

Comments
 (0)