Skip to content

PDP-11: _dbl_ext_cvt() does not work properly #323

@kwhr0

Description

@kwhr0

On PDP-11, integer and floating point number conversion instructions are signed.
In _dbl_ext_cvt() of lang/cem/libcc.ansi/core/stdlib/ext_comp.c, the return value of frexp() is 0.5<=value<1.0.

value *= 4294967296.0;
e->m1 = value;

Converting as above will overflow with signed 32 bits, so it will not work correctly.
If you replace the same function with the one in lang/cem/libcc/gen/ext_comp.c, it will work correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions