llvm.org GIT mirror llvm / 8319d44
[WebAssembly] Add V128 to WebAssemblyInstrInfo::copyPhysReg Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D53872 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346384 91177308-0d34-0410-b5e6-96231b3b80d8 Thomas Lively 10 months ago
2 changed file(s) with 82 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6969 CopyOpcode = WebAssembly::COPY_F32;
7070 else if (RC == &WebAssembly::F64RegClass)
7171 CopyOpcode = WebAssembly::COPY_F64;
72 else if (RC == &WebAssembly::V128RegClass)
73 CopyOpcode = WebAssembly::COPY_V128;
7274 else
7375 llvm_unreachable("Unexpected register class");
7476
0 # RUN: llc %s -o - -run-pass=postrapseudos | FileCheck %s
1 --- |
2 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-unknown"
4
5 define void @copy_i32() {
6 ret void
7 }
8
9 define void @copy_i64() {
10 ret void
11 }
12
13 define void @copy_f32() {
14 ret void
15 }
16
17 define void @copy_f64() {
18 ret void
19 }
20
21 define void @copy_v128() {
22 ret void
23 }
24 ...
25 ---
26 name: copy_i32
27 # CHECK-LABEL: copy_i32
28 body: |
29 ; CHECK-LABEL: bb.0:
30 ; CHECK-NEXT: %0:i32 = COPY_I32 %1:i32
31 ; CHECK-NEXT: RETURN_VOID
32 bb.0:
33 %0:i32 = COPY %1:i32
34 RETURN_VOID implicit-def $arguments
35 ...
36 ---
37 name: copy_i64
38 # CHECK-LABEL: copy_i64
39 body: |
40 ; CHECK-LABEL: bb.0:
41 ; CHECK-NEXT: %0:i64 = COPY_I64 %1:i64
42 ; CHECK-NEXT: RETURN_VOID
43 bb.0:
44 %0:i64 = COPY %1:i64
45 RETURN_VOID implicit-def $arguments
46 ...
47 ---
48 name: copy_f32
49 # CHECK-LABEL: copy_f32
50 body: |
51 ; CHECK-LABEL: bb.0:
52 ; CHECK-NEXT: %0:f32 = COPY_F32 %1:f32
53 ; CHECK-NEXT: RETURN_VOID
54 bb.0:
55 %0:f32 = COPY %1:f32
56 RETURN_VOID implicit-def $arguments
57 ...
58 ---
59 name: copy_f64
60 # CHECK-LABEL: copy_f64
61 body: |
62 ; CHECK-LABEL: bb.0:
63 ; CHECK-NEXT: %0:f64 = COPY_F64 %1:f64
64 ; CHECK-NEXT: RETURN_VOID
65 bb.0:
66 %0:f64 = COPY %1:f64
67 RETURN_VOID implicit-def $arguments
68 ...
69 ---
70 name: copy_v128
71 # CHECK-LABEL: copy_v128
72 body: |
73 ; CHECK-LABEL: bb.0:
74 ; CHECK-NEXT: %0:v128 = COPY_V128 %1:v128
75 ; CHECK-NEXT: RETURN_VOID
76 bb.0:
77 %0:v128 = COPY %1:v128
78 RETURN_VOID implicit-def $arguments
79 ...