mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[ms-inline asm] Add support for the [] operator. Essentially, [expr1][expr2] is
equivalent to [expr1 + expr2]. See test cases for more examples. rdar://12470392 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166949 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -8,3 +8,53 @@ mov [ebx].4, ecx
|
||||
// CHECK: movl %ecx, 4(%ebx)
|
||||
// CHECK: encoding: [0x89,0x4b,0x04]
|
||||
|
||||
_t21: ## @t21
|
||||
// CHECK: t21
|
||||
mov eax, [4*eax + 4]
|
||||
// CHECK: movl 4(,%eax,4), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
|
||||
mov eax, [4*eax][4]
|
||||
// CHECK: movl 4(,%eax,4), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
|
||||
|
||||
mov eax, [esi + eax]
|
||||
// CHECK: movl (%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x06]
|
||||
mov eax, [esi][eax]
|
||||
// CHECK: movl (%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x06]
|
||||
|
||||
mov eax, [esi + 4*eax]
|
||||
// CHECK: movl (%esi,%eax,4), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x86]
|
||||
mov eax, [esi][4*eax]
|
||||
// CHECK: movl (%esi,%eax,4), %eax
|
||||
// CHECK: # encoding: [0x8b,0x04,0x86]
|
||||
|
||||
mov eax, [esi + eax + 4]
|
||||
// CHECK: movl 4(%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
|
||||
mov eax, [esi][eax + 4]
|
||||
// CHECK: movl 4(%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
|
||||
mov eax, [esi + eax][4]
|
||||
// CHECK: movl 4(%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
|
||||
mov eax, [esi][eax][4]
|
||||
// CHECK: movl 4(%esi,%eax), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
|
||||
|
||||
mov eax, [esi + 2*eax + 4]
|
||||
// CHECK: movl 4(%esi,%eax,2), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
|
||||
mov eax, [esi][2*eax + 4]
|
||||
// CHECK: movl 4(%esi,%eax,2), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
|
||||
mov eax, [esi + 2*eax][4]
|
||||
// CHECK: movl 4(%esi,%eax,2), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
|
||||
mov eax, [esi][2*eax][4]
|
||||
// CHECK: movl 4(%esi,%eax,2), %eax
|
||||
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
|
||||
|
||||
ret
|
||||
|
Reference in New Issue
Block a user