Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] For Silvermont CPU use 16-bit division instead of 64-bit for sm…
…all positive numbers Differential Revision: http://reviews.llvm.org/D5938 llvm-svn: 222521
- Loading branch information
Alexey Volkov
committed
Nov 21, 2014
1 parent
30a9907
commit fd1731d
Showing
5 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+idivl-to-divb < %s | FileCheck -check-prefix=DIV32 %s | ||
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+idivq-to-divw < %s | FileCheck -check-prefix=DIV64 %s | ||
|
||
define i32 @div32(i32 %a, i32 %b) { | ||
entry: | ||
; DIV32-LABEL: div32: | ||
; DIV32: orl %{{.*}}, [[REG:%[a-z]+]] | ||
; DIV32: testl $-256, [[REG]] | ||
; DIV32: divb | ||
; DIV64-LABEL: div32: | ||
; DIV64-NOT: divb | ||
%div = sdiv i32 %a, %b | ||
ret i32 %div | ||
} | ||
|
||
define i64 @div64(i64 %a, i64 %b) { | ||
entry: | ||
; DIV32-LABEL: div64: | ||
; DIV32-NOT: divw | ||
; DIV64-LABEL: div64: | ||
; DIV64: orq %{{.*}}, [[REG:%[a-z]+]] | ||
; DIV64: testq $-65536, [[REG]] | ||
; DIV64: divw | ||
%div = sdiv i64 %a, %b | ||
ret i64 %div | ||
} | ||
|
||
|