Skip to content

Commit 341b7f5

Browse files
committed
Fix #24 by legalizing more fp intrinsics.
1 parent d3040c3 commit 341b7f5

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

llvm/lib/Target/Z80/GISel/Z80LegalizerInfo.cpp

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,51 @@ Z80LegalizerInfo::Z80LegalizerInfo(const Z80Subtarget &STI,
138138
getActionDefinitionsBuilder({G_FSHL, G_FSHR, G_MEMCPY, G_MEMMOVE, G_MEMSET})
139139
.custom();
140140

141-
getActionDefinitionsBuilder({G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FREM, G_FNEG,
142-
G_FABS, G_INTRINSIC_TRUNC, G_INTRINSIC_ROUND,
143-
G_FCEIL, G_FCOS, G_FSIN, G_FSQRT, G_FFLOOR,
144-
G_FMINNUM, G_FMAXNUM, G_FRINT, G_FNEARBYINT})
141+
getActionDefinitionsBuilder({G_INTRINSIC_TRUNC,
142+
G_INTRINSIC_ROUND,
143+
G_INTRINSIC_ROUNDEVEN,
144+
G_FADD,
145+
G_FSUB,
146+
G_FMUL,
147+
G_FMA,
148+
G_FMAD,
149+
G_FDIV,
150+
G_FREM,
151+
G_FPOW,
152+
G_FEXP,
153+
G_FEXP2,
154+
G_FLOG,
155+
G_FLOG2,
156+
G_FLOG10,
157+
G_FNEG,
158+
G_FABS,
159+
G_FCANONICALIZE,
160+
G_FMINNUM,
161+
G_FMAXNUM,
162+
G_FMINNUM_IEEE,
163+
G_FMAXNUM_IEEE,
164+
G_FMINIMUM,
165+
G_FMAXIMUM,
166+
G_FCEIL,
167+
G_FCOS,
168+
G_FSIN,
169+
G_FSQRT,
170+
G_FFLOOR,
171+
G_FRINT,
172+
G_FNEARBYINT})
145173
.libcallFor({s32, s64});
146174

147-
getActionDefinitionsBuilder(G_FCOPYSIGN)
148-
.libcallFor({{s32, s32}, {s64, s64}});
175+
getActionDefinitionsBuilder(G_FPEXT).libcallFor({{s64, s32}});
176+
177+
getActionDefinitionsBuilder(G_FPTRUNC).libcallFor({{s32, s64}});
149178

150-
getActionDefinitionsBuilder(G_FPTRUNC)
151-
.libcallFor({{s32, s64}});
179+
getActionDefinitionsBuilder(G_INTRINSIC_LRINT)
180+
.libcallFor({{s32, s32}, {s32, s64}});
152181

153-
getActionDefinitionsBuilder(G_FPEXT)
154-
.libcallFor({{s64, s32}});
182+
getActionDefinitionsBuilder(G_FPOWI).lower();
183+
184+
getActionDefinitionsBuilder(G_FCOPYSIGN)
185+
.libcallFor({{s32, s32}, {s64, s64}});
155186

156187
getActionDefinitionsBuilder({G_FPTOSI, G_FPTOUI})
157188
.libcallForCartesianProduct({s32, s64}, {s32, s64})

0 commit comments

Comments
 (0)