Skip to content

Cranelift: Little/Big endian has no effect on sload8x8 in s390x #10852

@akldc

Description

@akldc

.clif Test Case

test optimize    
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true
    target s390x

function %main() -> i64, i64 , i16x8 fast {
    ss0 = explicit_slot 32

block0:
    v1 = iconst.i64 0x0011_0022_0033_0044
    stack_store v1, ss0
    stack_store v1, ss0+8 
    stack_store v1, ss0+16
    stack_store v1, ss0+24
    
    v80 = stack_addr.i64 ss0
    v81 = load.i64 big v80
    v82 = sload8x8 big v80
    return v80, v81, v82
}

; print: %main()

Description

When I specify the load and sload8x8 instructions as big-endian

v81 = load.i64 big v80
v82 = sload8x8 big v80

the execution results are as follows.

%main() -> [274928428480, 4785220636311620, 0x00440000003300000022000000110000]

Then I changed them to little-endian, and the results are as follows.

v81 = load.i64 little v80
v82 = sload8x8 little v80
%main() -> [274928428480, 4899972470242545920, 0x00440000003300000022000000110000]

The value of v81 changed, which is expected. But the value of v82 stayed the same, indicating that little/big-endian has no effect on sload8x8.

Environment

qemu-s390x to emulate execution on an x86 machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorcranelift:area:s390xIssues related to Cranelift's s390x backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions