Skip to content

cmd/asm: s390x tests are suspicious #18295

@rsc

Description

@rsc

cmd/asm/internal/asm/testdata/s390x.s says:

    // Some vector instructions have their inputs reordered.
    // Typically the reordering puts the length/index input into From3.
    VGEG    $1, 8(R15)(V30*1), V31  // VGEG    8(R15)(V30*1), $1, V31  // e7fef0081c12
    VSCEG   $1, V31, 16(R15)(V30*1) // VSCEG   V31, $1, 16(R15)(V30*1) // e7fef0101c1a
    VGEF    $0, 2048(R15)(V1*1), V2 // VGEF    2048(R15)(V1*1), $0, V2 // e721f8000013
    VSCEF   $0, V2, 4095(R15)(V1*1) // VSCEF   V2, $0, 4095(R15)(V1*1) // e721ffff001b
    VLL     R0, (R15), V1           // VLL     (R15), R0, V1           // e710f0000037
    VSTL    R0, V16, (R15)          // VSTL    V16, R0, (R15)          // e700f000083f
    VGMH    $8, $16, V12            // VGMH    $16, $8, V12            // e7c008101046
    VLEIF   $2, $-43, V16           // VLEIF   $-43, $2, V16           // e700ffd52843
    VSLDB   $3, V1, V16, V18        // VSLDB   V1, V16, $3, V18        // e72100030a77
    VERIMB  $2, V31, V1, V2         // VERIMB  V31, V1, $2, V2         // e72f10020472
    VSEL    V1, V2, V3, V4          // VSEL    V2, V3, V1, V4          // e7412000308d

This seems wrong. The first column is the assembler input. The second column is the result of parsing column 1 and then printing it back. The second column is supposed to be semantically identical to the first, different only if the assembler printing uses a different spelling than the input. For example if you wrote 'MOV $0x00, R1' then it might reasonably print instead as 'MOV $0, R1'. But clearly the two mean the same thing as asssembler input.

In contrast, it is far from clear to me that 'VSEL V1, V2, V3, V4' and 'VSEL V2, V3, V1, V4' mean the same thing as assembler input. In fact I'd be very surprised if they did.

At this point probably the input meanings cannot be changed, but the printer should be fixed.

Not blocking Go 1.8.

/cc @mundaym @randall77

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions