File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
llvm/test/CodeGen/LoongArch Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2
+ ; RUN: llc --mtriple=loongarch64 --mattr=+lasx < %s | FileCheck %s
3
+
4
+ define i32 @bitcast_extract_v8f32 (<8 x float > %a ) nounwind {
5
+ ; CHECK-LABEL: bitcast_extract_v8f32:
6
+ ; CHECK: # %bb.0: # %entry
7
+ ; CHECK-NEXT: xvpickve2gr.w $a0, $xr0, 7
8
+ ; CHECK-NEXT: movgr2fr.w $fa0, $a0
9
+ ; CHECK-NEXT: movfr2gr.s $a0, $fa0
10
+ ; CHECK-NEXT: ret
11
+ entry:
12
+ %b = extractelement <8 x float > %a , i32 7
13
+ %c = bitcast float %b to i32
14
+ ret i32 %c
15
+ }
16
+
17
+ define i64 @bitcast_extract_v4f64 (<4 x double > %a ) nounwind {
18
+ ; CHECK-LABEL: bitcast_extract_v4f64:
19
+ ; CHECK: # %bb.0: # %entry
20
+ ; CHECK-NEXT: xvpickve2gr.d $a0, $xr0, 3
21
+ ; CHECK-NEXT: movgr2fr.d $fa0, $a0
22
+ ; CHECK-NEXT: movfr2gr.d $a0, $fa0
23
+ ; CHECK-NEXT: ret
24
+ entry:
25
+ %b = extractelement <4 x double > %a , i32 3
26
+ %c = bitcast double %b to i64
27
+ ret i64 %c
28
+ }
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2
+ ; RUN: llc --mtriple=loongarch64 --mattr=+lsx < %s | FileCheck %s
3
+
4
+ define i32 @bitcast_extract_v4f32 (<4 x float > %a ) nounwind {
5
+ ; CHECK-LABEL: bitcast_extract_v4f32:
6
+ ; CHECK: # %bb.0: # %entry
7
+ ; CHECK-NEXT: vreplvei.w $vr0, $vr0, 3
8
+ ; CHECK-NEXT: movfr2gr.s $a0, $fa0
9
+ ; CHECK-NEXT: ret
10
+ entry:
11
+ %b = extractelement <4 x float > %a , i32 3
12
+ %c = bitcast float %b to i32
13
+ ret i32 %c
14
+ }
15
+
16
+ define i64 @bitcast_extract_v2f64 (<2 x double > %a ) nounwind {
17
+ ; CHECK-LABEL: bitcast_extract_v2f64:
18
+ ; CHECK: # %bb.0: # %entry
19
+ ; CHECK-NEXT: vreplvei.d $vr0, $vr0, 1
20
+ ; CHECK-NEXT: movfr2gr.d $a0, $fa0
21
+ ; CHECK-NEXT: ret
22
+ entry:
23
+ %b = extractelement <2 x double > %a , i32 1
24
+ %c = bitcast double %b to i64
25
+ ret i64 %c
26
+ }
You can’t perform that action at this time.
0 commit comments