• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -sd | FileCheck  %s
2
3// Test that we correctly relax these instructions into versions that use
4// 16 or 32 bit immediate values.
5
6bar:
7// CHECK:      Name: imul
8// CHECK:      SectionData (
9// CHECK-NEXT:   0000: 6669DB00 0066691C 25000000 00000069
10// CHECK-NEXT:   0010: DB000000 00691C25 00000000 00000000
11// CHECK-NEXT:   0020: 4869DB00 00000048 691C2500 00000000
12// CHECK-NEXT:   0030: 000000
13// CHECK-NEXT: )
14        .section imul
15        imul $foo, %bx,  %bx
16        imul $foo, bar,  %bx
17        imul $foo, %ebx, %ebx
18        imul $foo, bar,  %ebx
19        imul $foo, %rbx, %rbx
20        imul $foo, bar,  %rbx
21
22
23// CHECK:      Name: and
24// CHECK:      SectionData (
25// CHECK-NEXT:   0000: 6681E300 00668124 25000000 00000081
26// CHECK-NEXT:   0010: E3000000 00812425 00000000 00000000
27// CHECK-NEXT:   0020: 4881E300 00000048 81242500 00000000
28// CHECK-NEXT:   0030: 000000
29// CHECK-NEXT: )
30        .section and
31        and  $foo, %bx
32        andw $foo, bar
33        and  $foo, %ebx
34        andl $foo, bar
35        and  $foo, %rbx
36        andq $foo, bar
37
38// CHECK:      Name: or
39// CHECK:      SectionData (
40// CHECK-NEXT:   0000: 6681CB00 0066810C 25000000 00000081
41// CHECK-NEXT:   0010: CB000000 00810C25 00000000 00000000
42// CHECK-NEXT:   0020: 4881CB00 00000048 810C2500 00000000
43// CHECK-NEXT:   0030: 000000
44// CHECK-NEXT: )
45        .section or
46        or  $foo, %bx
47        orw $foo, bar
48        or  $foo, %ebx
49        orl $foo, bar
50        or  $foo, %rbx
51        orq $foo, bar
52
53// CHECK:      Name: xor
54// CHECK:      SectionData (
55// CHECK-NEXT:   0000: 6681F300 00668134 25000000 00000081
56// CHECK-NEXT:   0010: F3000000 00813425 00000000 00000000
57// CHECK-NEXT:   0020: 4881F300 00000048 81342500 00000000
58// CHECK-NEXT:   0030: 000000
59// CHECK-NEXT: )
60        .section xor
61        xor  $foo, %bx
62        xorw $foo, bar
63        xor  $foo, %ebx
64        xorl $foo, bar
65        xor  $foo, %rbx
66        xorq $foo, bar
67
68// CHECK:      Name: add
69// CHECK:      SectionData (
70// CHECK-NEXT:   0000: 6681C300 00668104 25000000 00000081
71// CHECK-NEXT:   0010: C3000000 00810425 00000000 00000000
72// CHECK-NEXT:   0020: 4881C300 00000048 81042500 00000000
73// CHECK-NEXT:   0030: 000000
74// CHECK-NEXT: )
75        .section add
76        add  $foo, %bx
77        addw $foo, bar
78        add  $foo, %ebx
79        addl $foo, bar
80        add  $foo, %rbx
81        addq $foo, bar
82
83// CHECK:      Name: sub
84// CHECK:      SectionData (
85// CHECK-NEXT:   000: 6681EB00 0066812C 25000000 00000081
86// CHECK-NEXT:   010: EB000000 00812C25 00000000 00000000
87// CHECK-NEXT:   020: 4881EB00 00000048 812C2500 00000000
88// CHECK-NEXT:   030: 000000
89// CHECK-NEXT: )
90        .section sub
91        sub  $foo, %bx
92        subw $foo, bar
93        sub  $foo, %ebx
94        subl $foo, bar
95        sub  $foo, %rbx
96        subq $foo, bar
97
98// CHECK:      Name: cmp
99// CHECK:      SectionData (
100// CHECK-NEXT:   0000: 6681FB00 0066813C 25000000 00000081
101// CHECK-NEXT:   0010: FB000000 00813C25 00000000 00000000
102// CHECK-NEXT:   0020: 4881FB00 00000048 813C2500 00000000
103// CHECK-NEXT:   0030: 000000
104// CHECK-NEXT: )
105        .section cmp
106        cmp  $foo, %bx
107        cmpw $foo, bar
108        cmp  $foo, %ebx
109        cmpl $foo, bar
110        cmp  $foo, %rbx
111        cmpq $foo, bar
112