Skip to content

miscompilation of i512 #3821

@lattner

Description

@lattner
Bugzilla Link 3449
Resolution DUPLICATE
Resolved on Jan 31, 2009 02:34
Version 1.0
OS All
CC @sunfishcode

Extended Description

sumarrray-dbl now fails because SROA is promoting a struct to an i512 and codegen is shifting by the wrong amount. Here's a testcase:

define void @​test(<8 x double> %P, i64 %Q) nounwind {
%A = load <8 x double>* %P
%B = bitcast <8 x double> %A to i512 ; [#uses=2]
%C = lshr i512 %B, 448 ; [#uses=1]
%D = trunc i512 %C to i64 ; [#uses=1]
volatile store i64 %D, i64* %Q
ret void
}

I get:
$ llvm-as < ~/t.ll | llc -march=x86-64

_test:
movq 24(%rdi), %rax
movq %rax, (%rsi)
ret

bit 448 = byte 56 not byte 24. It looks like it is off by 32 or maybe modulusing by 32 or something weird like that?

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