Skip to content

'fpext float2 to double2' not lowered to 'cvtps2pd' #11706

@ZviRackover

Description

@ZviRackover
Bugzilla Link 11334
Resolution FIXED
Resolved on Sep 30, 2013 09:42
Version trunk
OS Linux
CC @darkbuck,@ZviRackover

Extended Description

Consider the following test:
; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=corei7 | FileCheck %s

define <2 x double> @​f2d_ext_vec(<2 x float> %v1) nounwind {
entry:
; CHECK: cvtps2pd
%f1 = fpext <2 x float> %v1 to <2 x double>
ret <2 x double> %f1
}

The generated code is:
movdqa %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
pshufd $1, %xmm1, %xmm1 # xmm1 = xmm1[1,0,0,0]
cvtss2sd %xmm1, %xmm1
unpcklpd %xmm1, %xmm0 # xmm0 = xmm0[0],xmm1[0]
ret

A more optimal code would be:
cvtps2pd %xmm0, %xmm0
ret

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions