Skip to content

Commit a618b49

Browse files
committed
[MIPS] Fix miscompiles consecutive half operations
Use softPromoteHalf legalization for fp16 rather than PromoteFloat. Fix #97975.
1 parent 9b5a303 commit a618b49

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/Target/Mips/MipsISelLowering.h

+2
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ class TargetRegisterClass;
365365
return ABI.IsN64() ? Mips::A1_64 : Mips::A1;
366366
}
367367

368+
bool softPromoteHalfType() const override { return true; }
369+
368370
bool isJumpTableRelative() const override {
369371
return getTargetMachine().isPositionIndependent();
370372
}

llvm/test/CodeGen/Mips/fp16-promote.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ define <4 x float> @test_vec_fpext_float(ptr %p) #0 {
6262
; CHECK-LIBCALL-LABEL: test_vec_fpext_double:
6363
; CHECK-LIBCALL: %call16(__gnu_h2f_ieee)
6464
; CHECK-LIBCALL: %call16(__gnu_h2f_ieee)
65-
; CHECK-LIBCALL: %call16(__gnu_h2f_ieee)
6665
; CHECK-LIBCALL: cvt.d.s
66+
; CHECK-LIBCALL: %call16(__gnu_h2f_ieee)
6767
; CHECK-LIBCALL: cvt.d.s
6868
; CHECK-LIBCALL: cvt.d.s
6969
; CHECK-LIBCALL: %call16(__gnu_h2f_ieee)

0 commit comments

Comments
 (0)