Skip to content

access to fused multiply-subtract etc. #15985

@stevengj

Description

@stevengj

Currently, f(x,y,z) = @fastmath muladd(x, y, -z) generates an explicit negation operation for the -z in the case of floating-point arguments, as can be seen by @code_native f(3.0, 4.0, 5.0). Similarly for muladd(-x, y, z) etcetera.

In #9881, @yuyichao indicated that this was due to the FastSel optimization in LLVM.

As I mentioned in #6330, it would be good to have access to fused multiply-subtract and similar operations. LLVM doesn't provide intrinsics for these, but it would be good to have a way to write code that LLVM can transform into such instructions when they are available, and that will avoid explicit negations when fused operations aren't available.

cc: @eschnett, @simonbyrne

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceMust go fasterupstreamThe issue is with an upstream dependency, e.g. LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions