Skip to content

Commit bec19e5

Browse files
committed
extra test and TODO
1 parent 7282510 commit bec19e5

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6997,6 +6997,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
69976997
getValue(I.getArgOperand(1)),
69986998
getValue(I.getArgOperand(2)), Flags));
69996999
} else if (TLI.isOperationLegalOrCustom(ISD::FMULADD, VT)) {
7000+
// TODO: Support splitting the vector.
70007001
setValue(&I, DAG.getNode(ISD::FMULADD, sdl,
70017002
getValue(I.getArgOperand(0)).getValueType(),
70027003
getValue(I.getArgOperand(0)),

llvm/test/CodeGen/WebAssembly/simd-relaxed-fma.ll

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,72 @@ define <4 x float> @fmuladd_4xf32(<4 x float> %a, <4 x float> %b, <4 x float> %c
10971097
ret <4 x float> %fma
10981098
}
10991099

1100+
define <8 x float> @fmuladd_8xf32(<8 x float> %a, <8 x float> %b, <8 x float> %c) {
1101+
; RELAXED-LABEL: fmuladd_8xf32:
1102+
; RELAXED: .functype fmuladd_8xf32 (i32, v128, v128, v128, v128, v128, v128) -> ()
1103+
; RELAXED-NEXT: # %bb.0:
1104+
; RELAXED-NEXT: f32x4.mul $push0=, $2, $4
1105+
; RELAXED-NEXT: f32x4.add $push1=, $pop0, $6
1106+
; RELAXED-NEXT: v128.store 16($0), $pop1
1107+
; RELAXED-NEXT: f32x4.mul $push2=, $1, $3
1108+
; RELAXED-NEXT: f32x4.add $push3=, $pop2, $5
1109+
; RELAXED-NEXT: v128.store 0($0), $pop3
1110+
; RELAXED-NEXT: return
1111+
;
1112+
; STRICT-LABEL: fmuladd_8xf32:
1113+
; STRICT: .functype fmuladd_8xf32 (i32, v128, v128, v128, v128, v128, v128) -> ()
1114+
; STRICT-NEXT: # %bb.0:
1115+
; STRICT-NEXT: f32x4.mul $push0=, $2, $4
1116+
; STRICT-NEXT: f32x4.add $push1=, $pop0, $6
1117+
; STRICT-NEXT: v128.store 16($0), $pop1
1118+
; STRICT-NEXT: f32x4.mul $push2=, $1, $3
1119+
; STRICT-NEXT: f32x4.add $push3=, $pop2, $5
1120+
; STRICT-NEXT: v128.store 0($0), $pop3
1121+
; STRICT-NEXT: return
1122+
;
1123+
; NOFP16-LABEL: fmuladd_8xf32:
1124+
; NOFP16: .functype fmuladd_8xf32 (i32, v128, v128, v128, v128, v128, v128) -> ()
1125+
; NOFP16-NEXT: # %bb.0:
1126+
; NOFP16-NEXT: f32x4.mul $push0=, $2, $4
1127+
; NOFP16-NEXT: f32x4.add $push1=, $pop0, $6
1128+
; NOFP16-NEXT: v128.store 16($0), $pop1
1129+
; NOFP16-NEXT: f32x4.mul $push2=, $1, $3
1130+
; NOFP16-NEXT: f32x4.add $push3=, $pop2, $5
1131+
; NOFP16-NEXT: v128.store 0($0), $pop3
1132+
; NOFP16-NEXT: return
1133+
;
1134+
; NOSIMD-LABEL: fmuladd_8xf32:
1135+
; NOSIMD: .functype fmuladd_8xf32 (i32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32) -> ()
1136+
; NOSIMD-NEXT: # %bb.0:
1137+
; NOSIMD-NEXT: f32.mul $push0=, $8, $16
1138+
; NOSIMD-NEXT: f32.add $push1=, $pop0, $24
1139+
; NOSIMD-NEXT: f32.store 28($0), $pop1
1140+
; NOSIMD-NEXT: f32.mul $push2=, $7, $15
1141+
; NOSIMD-NEXT: f32.add $push3=, $pop2, $23
1142+
; NOSIMD-NEXT: f32.store 24($0), $pop3
1143+
; NOSIMD-NEXT: f32.mul $push4=, $6, $14
1144+
; NOSIMD-NEXT: f32.add $push5=, $pop4, $22
1145+
; NOSIMD-NEXT: f32.store 20($0), $pop5
1146+
; NOSIMD-NEXT: f32.mul $push6=, $5, $13
1147+
; NOSIMD-NEXT: f32.add $push7=, $pop6, $21
1148+
; NOSIMD-NEXT: f32.store 16($0), $pop7
1149+
; NOSIMD-NEXT: f32.mul $push8=, $4, $12
1150+
; NOSIMD-NEXT: f32.add $push9=, $pop8, $20
1151+
; NOSIMD-NEXT: f32.store 12($0), $pop9
1152+
; NOSIMD-NEXT: f32.mul $push10=, $3, $11
1153+
; NOSIMD-NEXT: f32.add $push11=, $pop10, $19
1154+
; NOSIMD-NEXT: f32.store 8($0), $pop11
1155+
; NOSIMD-NEXT: f32.mul $push12=, $2, $10
1156+
; NOSIMD-NEXT: f32.add $push13=, $pop12, $18
1157+
; NOSIMD-NEXT: f32.store 4($0), $pop13
1158+
; NOSIMD-NEXT: f32.mul $push14=, $1, $9
1159+
; NOSIMD-NEXT: f32.add $push15=, $pop14, $17
1160+
; NOSIMD-NEXT: f32.store 0($0), $pop15
1161+
; NOSIMD-NEXT: return
1162+
%fma = call <8 x float> @llvm.fmuladd(<8 x float> %a, <8 x float> %b, <8 x float> %c)
1163+
ret <8 x float> %fma
1164+
}
1165+
11001166
define <2 x double> @fmuladd_contract_2xf64(<2 x double> %a, <2 x double> %b, <2 x double> %c) {
11011167
; RELAXED-LABEL: fmuladd_contract_2xf64:
11021168
; RELAXED: .functype fmuladd_contract_2xf64 (v128, v128, v128) -> (v128)

0 commit comments

Comments
 (0)