-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
Description
| Bugzilla Link | 12618 |
| Version | trunk |
| OS | Windows NT |
| Blocks | llvm/llvm-bugzilla-archive#31265 |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl |
Extended Description
Hello guys,
following LLVM ir
define inlinehint <3 x i1> @"Mbool3@@QBB@@QBB@@QBB@@"(i1 %.v0, i1 %.v1, i1 %.v2) {
.body:
%0 = insertelement <3 x i1> undef, i1 %.v0, i32 0
%1 = insertelement <3 x i1> %0, i1 %.v1, i32 1
%2 = insertelement <3 x i1> %1, i1 %.v2, i32 2
ret <3 x i1> %2
}generates ASMs:
005400C0 mov cl,byte ptr [esp+10h]
005400C4 and cl,1
005400C7 mov eax,dword ptr [esp+4]
005400CB mov byte ptr [eax],cl
005400CD mov cl,byte ptr [esp+0Ch]
005400D1 and cl,1
005400D4 mov byte ptr [eax],cl
005400D6 mov cl,byte ptr [esp+8]
005400DA and cl,1
005400DD mov byte ptr [eax],cl
005400DF ret And this is not correct. In my opinion, following code would be generated:
005400C0 mov cl,byte ptr [esp+10h]
005400C4 and cl,1
005400C7 mov eax,dword ptr [esp+4]
005400CB mov byte ptr [eax+1],cl ; offset
005400CD mov cl,byte ptr [esp+0Ch]
005400D1 and cl,1
005400D4 mov byte ptr [eax+2],cl
005400D6 mov cl,byte ptr [esp+8] ; offset
005400DA and cl,1
005400DD mov byte ptr [eax],cl ; offset
005400DF ret Am I right?
And another question, why the argument order is +10h +0Ch and +8h rather than ascending or descending ?