Skip to content

Commit d9472cc

Browse files
committed
Skip expansion when f16 is enabled.
1 parent 61bb886 commit d9472cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
143143
// Support minimum and maximum, which otherwise default to expand.
144144
setOperationAction(ISD::FMINIMUM, T, Legal);
145145
setOperationAction(ISD::FMAXIMUM, T, Legal);
146-
// WebAssembly currently has no builtin f16 support.
147-
setOperationAction(ISD::FP16_TO_FP, T, Expand);
148-
setOperationAction(ISD::FP_TO_FP16, T, Expand);
146+
// When experimental vector f16 is enabled these instructions don't need to
147+
// be expanded for v8f16.
148+
if (T != MVT::v8f16) {
149+
setOperationAction(ISD::FP16_TO_FP, T, Expand);
150+
setOperationAction(ISD::FP_TO_FP16, T, Expand);
151+
}
149152
setLoadExtAction(ISD::EXTLOAD, T, MVT::f16, Expand);
150153
setTruncStoreAction(T, MVT::f16, Expand);
151154
}

0 commit comments

Comments
 (0)