@@ -1010,3 +1010,61 @@ define <2 x i32> @fshr_vec_zero_elem(<2 x i32> %x, <2 x i32> %y) {
1010
1010
%fsh = call <2 x i32 > @llvm.fshr.v2i32 (<2 x i32 > %x , <2 x i32 > %y , <2 x i32 > <i32 2 , i32 0 >)
1011
1011
ret <2 x i32 > %fsh
1012
1012
}
1013
+
1014
+ define i16 @fshl_i16_shl (i16 %x , i16 %y ) {
1015
+ ; CHECK-LABEL: @fshl_i16_shl(
1016
+ ; CHECK-NEXT: entry:
1017
+ ; CHECK-NEXT: [[TMP0:%.*]] = and i16 [[Y:%.*]], 15
1018
+ ; CHECK-NEXT: [[RES:%.*]] = shl i16 [[X:%.*]], [[TMP0]]
1019
+ ; CHECK-NEXT: ret i16 [[RES]]
1020
+ ;
1021
+ entry:
1022
+ %res = call i16 @llvm.fshl.i16 (i16 %x , i16 0 , i16 %y )
1023
+ ret i16 %res
1024
+ }
1025
+
1026
+ define i32 @fshl_i32_shl (i32 %x , i32 %y ) {
1027
+ ; CHECK-LABEL: @fshl_i32_shl(
1028
+ ; CHECK-NEXT: entry:
1029
+ ; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[Y:%.*]], 31
1030
+ ; CHECK-NEXT: [[RES:%.*]] = shl i32 [[X:%.*]], [[TMP0]]
1031
+ ; CHECK-NEXT: ret i32 [[RES]]
1032
+ ;
1033
+ entry:
1034
+ %res = call i32 @llvm.fshl.i32 (i32 %x , i32 0 , i32 %y )
1035
+ ret i32 %res
1036
+ }
1037
+
1038
+ define <2 x i16 > @fshl_vi16_shl (<2 x i16 > %x , <2 x i16 > %y ) {
1039
+ ; CHECK-LABEL: @fshl_vi16_shl(
1040
+ ; CHECK-NEXT: entry:
1041
+ ; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i16> [[Y:%.*]], splat (i16 15)
1042
+ ; CHECK-NEXT: [[RES:%.*]] = shl <2 x i16> [[X:%.*]], [[TMP0]]
1043
+ ; CHECK-NEXT: ret <2 x i16> [[RES]]
1044
+ ;
1045
+ entry:
1046
+ %res = call <2 x i16 > @llvm.fshl.v2i16 (<2 x i16 > %x , <2 x i16 > zeroinitializer , <2 x i16 > %y )
1047
+ ret <2 x i16 > %res
1048
+ }
1049
+
1050
+ define i32 @fshr_i32_shl_negative_test (i32 %x , i32 %y ) {
1051
+ ; CHECK-LABEL: @fshr_i32_shl_negative_test(
1052
+ ; CHECK-NEXT: entry:
1053
+ ; CHECK-NEXT: [[RES:%.*]] = call i32 @llvm.fshr.i32(i32 [[X:%.*]], i32 0, i32 [[Y:%.*]])
1054
+ ; CHECK-NEXT: ret i32 [[RES]]
1055
+ ;
1056
+ entry:
1057
+ %res = call i32 @llvm.fshr.i32 (i32 %x , i32 0 , i32 %y )
1058
+ ret i32 %res
1059
+ }
1060
+
1061
+ define <2 x i31 > @fshl_vi31_shl_negative_test (<2 x i31 > %x , <2 x i31 > %y ) {
1062
+ ; CHECK-LABEL: @fshl_vi31_shl_negative_test(
1063
+ ; CHECK-NEXT: entry:
1064
+ ; CHECK-NEXT: [[RES:%.*]] = call <2 x i31> @llvm.fshl.v2i31(<2 x i31> [[X:%.*]], <2 x i31> zeroinitializer, <2 x i31> [[Y:%.*]])
1065
+ ; CHECK-NEXT: ret <2 x i31> [[RES]]
1066
+ ;
1067
+ entry:
1068
+ %res = call <2 x i31 > @llvm.fshl.v2i31 (<2 x i31 > %x , <2 x i31 > zeroinitializer , <2 x i31 > %y )
1069
+ ret <2 x i31 > %res
1070
+ }
0 commit comments