mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
7b7d569297
Summary: A lot of the pseudo instructions are required because LLVM assumes that all integers of the same size as the pointer size are legal. This means that it will not currently expand 16-bit instructions to their 8-bit variants because it thinks 16-bit types are legal for the operations. This also adds all of the CodeGen tests that required the pass to run. Reviewers: arsenm, kparzysz Subscribers: wdng, mgorny, modocache, llvm-commits Differential Revision: https://reviews.llvm.org/D26577 llvm-svn: 287162
41 lines
659 B
LLVM
41 lines
659 B
LLVM
; RUN: llc < %s -march=avr | FileCheck %s
|
|
|
|
define i8 @com8(i8 %x) {
|
|
; CHECK-LABEL: com8:
|
|
; CHECK: com r24
|
|
%neg = xor i8 %x, -1
|
|
ret i8 %neg
|
|
}
|
|
|
|
define i16 @com16(i16 %x) {
|
|
; CHECK-LABEL: com16:
|
|
; CHECK: com r24
|
|
; CHECK: com r25
|
|
%neg = xor i16 %x, -1
|
|
ret i16 %neg
|
|
}
|
|
|
|
define i32 @com32(i32 %x) {
|
|
; CHECK-LABEL: com32:
|
|
; CHECK: com r22
|
|
; CHECK: com r23
|
|
; CHECK: com r24
|
|
; CHECK: com r25
|
|
%neg = xor i32 %x, -1
|
|
ret i32 %neg
|
|
}
|
|
|
|
define i64 @com64(i64 %x) {
|
|
; CHECK-LABEL: com64:
|
|
; CHECK: com r18
|
|
; CHECK: com r19
|
|
; CHECK: com r20
|
|
; CHECK: com r21
|
|
; CHECK: com r22
|
|
; CHECK: com r23
|
|
; CHECK: com r24
|
|
; CHECK: com r25
|
|
%neg = xor i64 %x, -1
|
|
ret i64 %neg
|
|
}
|