Skip to content

Commit e5f95c6

Browse files
[RISCV] Fix CASE_VFMA_CHANGE_OPCODE_VV to handle MF4 pseudos
1 parent e59632b commit e5f95c6

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2+
# RUN: llc -mtriple=riscv32 -mattr=+v,+zfh,+zvfh,+f,+d -riscv-v-vector-bits-min=128 -run-pass=machine-cse -o - %s | FileCheck %s
3+
4+
---
5+
name: test
6+
alignment: 4
7+
tracksRegLiveness: true
8+
constants:
9+
- id: 0
10+
value: half 0xHC200
11+
alignment: 2
12+
isTargetSpecific: false
13+
- id: 1
14+
value: half 0xH3C00
15+
alignment: 2
16+
isTargetSpecific: false
17+
- id: 2
18+
value: half 0xHB800
19+
alignment: 2
20+
isTargetSpecific: false
21+
body: |
22+
bb.0:
23+
; CHECK-LABEL: name: test
24+
; CHECK: [[LUI:%[0-9]+]]:gpr = LUI target-flags(riscv-hi) %const.0
25+
; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI killed [[LUI]], target-flags(riscv-lo) %const.0
26+
; CHECK-NEXT: [[PseudoVLSE16_V_MF4_:%[0-9]+]]:vr = PseudoVLSE16_V_MF4 $noreg, killed [[ADDI]], $x0, 2, 4 /* e16 */, 3 /* ta, ma */ :: (load (s16) from constant-pool)
27+
; CHECK-NEXT: [[LUI1:%[0-9]+]]:gpr = LUI target-flags(riscv-hi) %const.1
28+
; CHECK-NEXT: [[ADDI1:%[0-9]+]]:gpr = ADDI killed [[LUI1]], target-flags(riscv-lo) %const.1
29+
; CHECK-NEXT: [[PseudoVLSE16_V_MF4_1:%[0-9]+]]:vr = PseudoVLSE16_V_MF4 $noreg, killed [[ADDI1]], $x0, 2, 4 /* e16 */, 3 /* ta, ma */ :: (load (s16) from constant-pool)
30+
; CHECK-NEXT: [[PseudoVFRSQRT7_V_MF4_E16_:%[0-9]+]]:vr = nofpexcept PseudoVFRSQRT7_V_MF4_E16 $noreg, killed [[PseudoVLSE16_V_MF4_1]], 2, 4 /* e16 */, 3 /* ta, ma */
31+
; CHECK-NEXT: [[PseudoVFMADD_VV_MF4_E16_:%[0-9]+]]:vr = ninf contract afn nofpexcept PseudoVFMADD_VV_MF4_E16 [[PseudoVFRSQRT7_V_MF4_E16_]], [[PseudoVFRSQRT7_V_MF4_E16_]], killed [[PseudoVLSE16_V_MF4_]], 7, 2, 4 /* e16 */, 3 /* ta, ma */, implicit $frm
32+
; CHECK-NEXT: $v8 = COPY [[PseudoVFMADD_VV_MF4_E16_]]
33+
; CHECK-NEXT: PseudoRET implicit $v8
34+
%0:gpr = LUI target-flags(riscv-hi) %const.0
35+
%1:gpr = ADDI killed %0, target-flags(riscv-lo) %const.0
36+
%2:vr = PseudoVLSE16_V_MF4 $noreg, killed %1, $x0, 2, 4 /* e16 */, 3 :: (load (s16) from constant-pool)
37+
%3:gpr = LUI target-flags(riscv-hi) %const.1
38+
%4:gpr = ADDI killed %3, target-flags(riscv-lo) %const.1
39+
%5:vr = PseudoVLSE16_V_MF4 $noreg, killed %4, $x0, 2, 4 /* e16 */, 3 :: (load (s16) from constant-pool)
40+
%6:vr = nofpexcept PseudoVFRSQRT7_V_MF4_E16 $noreg, killed %5, 2, 4 /* e16 */, 3 /* ta, ma */
41+
%7:vr = ninf contract afn nofpexcept PseudoVFMADD_VV_MF4_E16 %6, %6, killed %2, 7, 2, 4 /* e16 */, 3 /* ta, ma */, implicit $frm
42+
$v8 = COPY %7
43+
PseudoRET implicit $v8
44+
45+
...

0 commit comments

Comments
 (0)