Skip to content

Should it be possible to use long long? #58

@jszuppe

Description

@jszuppe

File test/libclcxx/pipes/TestBasicPipeStructData.cl (OpenCL 2.2 C++) from libclcxx tests contains a structure which contains a long long member. If you compile that file as describled in the readme there are no errors. If later you translate binary .spir file to text SPIR-V .spt file (using llvm-spirv or spirv-dis), it turns out that there is a TypeInt <id> 128 0 SPIR-V instruction, which defines a 128-bit integer.

That means that not only OpenCL C++ compiler accepted long long type, which is not defined in OpenCL C++ spec (however, long long is a reserved for future use), but also compiled it to 128-bit integer (I would somehow understand if it compiles long long to 64-bit integer`).

// in .cl file:
struct structType
{
    float a;
    int b;
    long long c;
};

// in .spt file:
4 TypeInt <ID> 128 0

Is it correct behaviour? Because I would expect a compilation error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions