Skip to content

On PowerPC, Clang uses the wrong mul/div functions for __float128 _Complex #216820

Description

@beetrees

On PowerPC, Clang will miscompile the following code (compiler explorer):

__float128 _Complex mul_f128(__float128 _Complex a, __float128 _Complex b) {
    return a * b;
}

__ibm128 _Complex mul_ibm(__ibm128 _Complex a, __ibm128 _Complex b) {
    return a * b;
}

__float128 _Complex div_f128(__float128 _Complex a, __float128 _Complex b) {
    return a / b;
}

__ibm128 _Complex div_ibm(__ibm128 _Complex a, __ibm128 _Complex b) {
    return a / b;
}

GCC correctly uses the __mulkc3/__divkc3 functions for __float128 and the __multc3/__divtc3 functions for __ibm128, whereas Clang uses __multc3/__divtc3 for both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions