This is an archive of the discontinued LLVM Phabricator instance.

[Aarch64] Add cost for missing extensions.
ClosedPublic

Authored by dewen on Jul 26 2022, 6:18 AM.

Details

Summary

This patch adds a cost estimate for some missing sign extensions.
ref: https://reviews.llvm.org/D14730

Diff Detail

Event Timeline

dewen created this revision.Jul 26 2022, 6:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2022, 6:18 AM
dewen requested review of this revision.Jul 26 2022, 6:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2022, 6:18 AM

Sounds OK. Can you add UINT_TO_FP too, to keep them symmetrical.

dewen updated this revision to Diff 447955.Jul 27 2022, 1:58 AM
dewen added a comment.EditedJul 27 2022, 2:01 AM

Sounds OK. Can you add UINT_TO_FP too, to keep them symmetrical.

Thank you for your review. I'll revise it, thank you.

dewen edited reviewers, added: mstorsjo; removed: guopeilin.Jul 27 2022, 6:30 PM
dewen added a comment.Jul 27 2022, 6:36 PM

for example:

define <4 x double> @test_unsigned_v4i32_to_v4f64(<4 x i32> %v) nounwind readnone {
  %conv = uitofp <4 x i32> %v to <4 x double>
  ret <4 x double> %conv
}

define <4 x double> @test_signed_v4i32_to_v4f64(<4 x i32> %v) nounwind readnone {
  %conv = sitofp <4 x i32> %v to <4 x double>
  ret <4 x double> %conv
}

to

.text
        .file   "585_1.ll"
        .globl  test_unsigned_v4i32_to_v4f64    // -- Begin function test_unsigned_v4i32_to_v4f64
        .p2align        2
        .type   test_unsigned_v4i32_to_v4f64,@function
test_unsigned_v4i32_to_v4f64:           // @test_unsigned_v4i32_to_v4f64
// %bb.0:
        ushll2.2d       v1, v0, #0
        ushll.2d        v0, v0, #0
        ucvtf.2d        v1, v1
        ucvtf.2d        v0, v0
        ret
.Lfunc_end0:
        .size   test_unsigned_v4i32_to_v4f64, .Lfunc_end0-test_unsigned_v4i32_to_v4f64
                                        // -- End function
        .globl  test_signed_v4i32_to_v4f64      // -- Begin function test_signed_v4i32_to_v4f64
        .p2align        2
        .type   test_signed_v4i32_to_v4f64,@function
test_signed_v4i32_to_v4f64:             // @test_signed_v4i32_to_v4f64
// %bb.0:
        sshll2.2d       v1, v0, #0
        sshll.2d        v0, v0, #0
        scvtf.2d        v1, v1
        scvtf.2d        v0, v0
        ret
.Lfunc_end1:
        .size   test_signed_v4i32_to_v4f64, .Lfunc_end1-test_signed_v4i32_to_v4f64
                                        // -- End function
        .section        ".note.GNU-stack","",@progbits
dmgreen accepted this revision.Jul 27 2022, 11:51 PM

LGTM Thanks

This revision is now accepted and ready to land.Jul 27 2022, 11:51 PM
This revision was landed with ongoing or failed builds.Jul 28 2022, 2:34 AM
This revision was automatically updated to reflect the committed changes.