File tree 3 files changed +27
-3
lines changed 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
96
96
setOperationAction (ISD::STORE, T, Custom);
97
97
}
98
98
}
99
+ if (Subtarget->hasFP16 ()) {
100
+ setOperationAction (ISD::LOAD, MVT::v8f16, Custom);
101
+ setOperationAction (ISD::STORE, MVT::v8f16, Custom);
102
+ }
99
103
if (Subtarget->hasReferenceTypes ()) {
100
104
// We need custom load and store lowering for both externref, funcref and
101
105
// Other. The MVT::Other here represents tables of reference types.
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ defm LOAD_V128_A64 :
189
189
}
190
190
191
191
// Def load patterns from WebAssemblyInstrMemory.td for vector types
192
- foreach vec = StdVecs in {
192
+ foreach vec = AllVecs in {
193
193
defm : LoadPat<vec.vt, load, "LOAD_V128">;
194
194
}
195
195
@@ -390,7 +390,7 @@ defm STORE_V128_A64 :
390
390
}
391
391
392
392
// Def store patterns from WebAssemblyInstrMemory.td for vector types
393
- foreach vec = StdVecs in {
393
+ foreach vec = AllVecs in {
394
394
defm : StorePat<vec.vt, store, "STORE_V128">;
395
395
}
396
396
Original file line number Diff line number Diff line change 1
1
; RUN: llc < %s --mtriple=wasm32-unknown-unknown -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+fp16,+simd128 | FileCheck %s
2
- ; RUN: llc < %s --mtriple=wasm64-unknown-unknown -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+fp16,+simd128 | FileCheck %s
3
2
4
3
declare float @llvm.wasm.loadf32.f16 (ptr )
5
4
declare void @llvm.wasm.storef16.f32 (float , ptr )
@@ -308,3 +307,24 @@ define <8 x i16> @trunc_sat_u_v8i16_sat(<8 x half> %x) {
308
307
%a = call <8 x i16 > @llvm.fptoui.sat.v8i16.v8f16 (<8 x half > %x )
309
308
ret <8 x i16 > %a
310
309
}
310
+
311
+ ; ==============================================================================
312
+ ; Load and Store
313
+ ; ==============================================================================
314
+ define <8 x half > @load_v8f16 (ptr %p ) {
315
+ ; CHECK-LABEL: load_v8f16:
316
+ ; CHECK: .functype load_v8f16 (i32) -> (v128)
317
+ ; CHECK-NEXT: v128.load $push0=, 0($0)
318
+ ; CHECK-NEXT: return $pop0
319
+ %v = load <8 x half >, ptr %p
320
+ ret <8 x half > %v
321
+ }
322
+
323
+ define void @store_v8f16 (<8 x half > %v , ptr %p ) {
324
+ ; CHECK-LABEL: store_v8f16:
325
+ ; CHECK: .functype store_v8f16 (v128, i32) -> ()
326
+ ; CHECK-NEXT: v128.store 0($1), $0
327
+ ; CHECK-NEXT: return
328
+ store <8 x half > %v , ptr %p
329
+ ret void
330
+ }
You can’t perform that action at this time.
0 commit comments