llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open ZviRackover opened this issue 15 years ago • 1 comments

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

ZviRackover avatar Nov 08 '11 13:11 ZviRackover

fix is committed as r161894

darkbuck avatar Aug 14 '12 23:08 darkbuck