~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/test/CodeGen/X86/add.ll

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc < %s -march=x86 | FileCheck %s -check-prefix=X32
 
2
; RUN: llc < %s -march=x86-64 | FileCheck %s -check-prefix=X64
 
3
 
 
4
; The immediate can be encoded in a smaller way if the
 
5
; instruction is a sub instead of an add.
 
6
 
 
7
define i32 @test1(i32 inreg %a) nounwind {
 
8
  %b = add i32 %a, 128
 
9
  ret i32 %b
 
10
; X32: subl     $-128, %eax
 
11
; X64: subl $-128, 
 
12
}
 
13
define i64 @test2(i64 inreg %a) nounwind {
 
14
  %b = add i64 %a, 2147483648
 
15
  ret i64 %b
 
16
; X32: addl     $-2147483648, %eax
 
17
; X64: subq     $-2147483648,
 
18
}
 
19
define i64 @test3(i64 inreg %a) nounwind {
 
20
  %b = add i64 %a, 128
 
21
  ret i64 %b
 
22
  
 
23
; X32: addl $128, %eax
 
24
; X64: subq     $-128,
 
25
}
 
26
 
 
27
define i1 @test4(i32 %v1, i32 %v2, i32* %X) nounwind {
 
28
entry:
 
29
  %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
 
30
  %sum = extractvalue {i32, i1} %t, 0
 
31
  %obit = extractvalue {i32, i1} %t, 1
 
32
  br i1 %obit, label %overflow, label %normal
 
33
 
 
34
normal:
 
35
  store i32 0, i32* %X
 
36
  br label %overflow
 
37
 
 
38
overflow:
 
39
  ret i1 false
 
40
  
 
41
; X32: test4:
 
42
; X32: addl
 
43
; X32-NEXT: jo
 
44
 
 
45
; X64:        test4:
 
46
; X64:          addl    %esi, %edi
 
47
; X64-NEXT:     jo
 
48
}
 
49
 
 
50
define i1 @test5(i32 %v1, i32 %v2, i32* %X) nounwind {
 
51
entry:
 
52
  %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
 
53
  %sum = extractvalue {i32, i1} %t, 0
 
54
  %obit = extractvalue {i32, i1} %t, 1
 
55
  br i1 %obit, label %carry, label %normal
 
56
 
 
57
normal:
 
58
  store i32 0, i32* %X
 
59
  br label %carry
 
60
 
 
61
carry:
 
62
  ret i1 false
 
63
 
 
64
; X32: test5:
 
65
; X32: addl
 
66
; X32-NEXT: jb
 
67
 
 
68
; X64:        test5:
 
69
; X64:          addl    %esi, %edi
 
70
; X64-NEXT:     jb
 
71
}
 
72
 
 
73
declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32)
 
74
declare {i32, i1} @llvm.uadd.with.overflow.i32(i32, i32)
 
75
 
 
76
 
 
77
define i64 @test6(i64 %A, i32 %B) nounwind {
 
78
        %tmp12 = zext i32 %B to i64             ; <i64> [#uses=1]
 
79
        %tmp3 = shl i64 %tmp12, 32              ; <i64> [#uses=1]
 
80
        %tmp5 = add i64 %tmp3, %A               ; <i64> [#uses=1]
 
81
        ret i64 %tmp5
 
82
 
 
83
; X32: test6:
 
84
; X32:      movl 12(%esp), %edx
 
85
; X32-NEXT: addl 8(%esp), %edx
 
86
; X32-NEXT: movl 4(%esp), %eax
 
87
; X32-NEXT: ret
 
88
        
 
89
; X64: test6:
 
90
; X64:  shlq    $32, %rsi
 
91
; X64:  leaq    (%rsi,%rdi), %rax
 
92
; X64:  ret
 
93
}
 
94