ret <2 x i64> %shl
}
+define <2 x i8> @ashr_demanded_bits_splat(<2 x i8> %x) {
+; CHECK-LABEL: @ashr_demanded_bits_splat(
+; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> %x, <i8 -128, i8 -128>
+; CHECK-NEXT: [[SHR:%.*]] = ashr exact <2 x i8> [[AND]], <i8 7, i8 7>
+; CHECK-NEXT: ret <2 x i8> [[SHR]]
+;
+ %and = and <2 x i8> %x, <i8 128, i8 128>
+ %shr = ashr <2 x i8> %and, <i8 7, i8 7>
+ ret <2 x i8> %shr
+}
+
+define <2 x i8> @lshr_demanded_bits_splat(<2 x i8> %x) {
+; CHECK-LABEL: @lshr_demanded_bits_splat(
+; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> %x, <i8 -128, i8 -128>
+; CHECK-NEXT: [[SHR:%.*]] = lshr exact <2 x i8> [[AND]], <i8 7, i8 7>
+; CHECK-NEXT: ret <2 x i8> [[SHR]]
+;
+ %and = and <2 x i8> %x, <i8 128, i8 128>
+ %shr = lshr <2 x i8> %and, <i8 7, i8 7>
+ ret <2 x i8> %shr
+}
+