Import the patterns via tablegen.
Putting this in AArch64InstrGISel.td assuming it wasn't in SelectionDAGCompat.td for a good reason.
Differential D115381
[AArch64][GlobalISel] Select scalar G_FMAXIMUM + G_FMINIMUM paquette on Dec 8 2021, 12:44 PM. Authored by
Details Import the patterns via tablegen. Putting this in AArch64InstrGISel.td assuming it wasn't in SelectionDAGCompat.td for a good reason.
Diff Detail Event Timeline
Comment Actions I haven't a clue what's going on with signaling NaNs and llvm. I think the safest thing is to emulate existing codegen behavior and maybe someone else, @eli.friedman? might be able to explain. Comment Actions As far as I can tell, the AArch64 fmaxnm actually corresponds to ISD::FMAXNUM_IEEE. I wouldn't be surprised if SelectionDAG is wrong; rG687ec75d was implemented well after the AArch64 backend was written. Granted, SNaNs are rarely used, especially with floating-point exceptions disabled, so maybe nobody noticed. Comment Actions Generic part LGTM, I have no idea about the AArch64 instruction behavior
Comment Actions Since the correctness of FMAXIMUM/FMINIMUM aren't in question, this LGTM assuming we move it to SelectionDAGCompat.td instead. |
Am I reading the ARM/GISel docs correctly that G_FMAXIMUM corresponds to the FMAX instructions, G_FMAXNUM_IEEE corresponds to FMAXNM, and that there isn't direct support on ARMv8 for G_FMAXNUM?
A quick look at the SelectionDAG code suggests the opposite re: FMAXNM vs FMAXNM_IEEE though... so there's either a bug in my understanding, or SDAG got it wrong?