File tree 1 file changed +13
-0
lines changed 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,19 @@ define i32 @combine_pmaddwd_constant() {
98
98
ret i32 %2
99
99
}
100
100
101
+ ; ensure we don't assume pmaddwd performs add nsw
102
+ define i32 @combine_pmaddwd_constant_nsw () {
103
+ ; CHECK-LABEL: combine_pmaddwd_constant_nsw:
104
+ ; CHECK: # %bb.0:
105
+ ; CHECK-NEXT: movl $-2147483648, %eax # imm = 0x80000000
106
+ ; CHECK-NEXT: retq
107
+ %1 = insertelement <8 x i16 > undef , i16 32768 , i32 0
108
+ %2 = shufflevector <8 x i16 > %1 , <8 x i16 > undef , <8 x i32 > zeroinitializer
109
+ %3 = call <4 x i32 > @llvm.x86.sse2.pmadd.wd (<8 x i16 > %2 , <8 x i16 > %2 )
110
+ %4 = extractelement <4 x i32 > %3 , i32 0 ; (-32768*-32768)+(-32768*-32768) = 0x80000000
111
+ ret i32 %4
112
+ }
113
+
101
114
define <8 x i16 > @combine_pmaddubsw_zero (<16 x i8 > %a0 , <16 x i8 > %a1 ) {
102
115
; SSE-LABEL: combine_pmaddubsw_zero:
103
116
; SSE: # %bb.0:
You can’t perform that action at this time.
0 commit comments