mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
bc8c141758
Summary: Re-lands r328386 and r328443, reverting r328482. Incorporates fixes from @mstorsjo in D44876 (thanks!) so that small parameters in i8 and i16 do not end up in the SysV register parameters (EDI, ESI, etc). I added tests for how we receive small parameters, since that is the important part. It's always safe to store more bytes than will be read, but the assumptions you make when loading them are what really matter. I also tested this by self-hosting clang and it passed tests on win64. Reviewers: mstorsjo, hans Subscribers: hiraditya, mstorsjo, llvm-commits Differential Revision: https://reviews.llvm.org/D44900 llvm-svn: 328570
34 lines
719 B
LLVM
34 lines
719 B
LLVM
; RUN: llc < %s -mtriple=i686-windows-msvc | FileCheck %s
|
|
; RUN: llc < %s -mtriple=i686-windows-gnu | FileCheck %s
|
|
|
|
define x86_fastcallcc i32 @pass_fast_bool(i1 inreg zeroext %b) {
|
|
entry:
|
|
%cond = select i1 %b, i32 66, i32 0
|
|
ret i32 %cond
|
|
}
|
|
|
|
; CHECK-LABEL: @pass_fast_bool@4:
|
|
; CHECK-DAG: testb %cl, %cl
|
|
; CHECK-DAG: movl $66,
|
|
; CHECK: retl
|
|
|
|
define x86_vectorcallcc i32 @pass_vector_bool(i1 inreg zeroext %b) {
|
|
entry:
|
|
%cond = select i1 %b, i32 66, i32 0
|
|
ret i32 %cond
|
|
}
|
|
|
|
; CHECK-LABEL: pass_vector_bool@@4:
|
|
; CHECK-DAG: testb %cl, %cl
|
|
; CHECK-DAG: movl $66,
|
|
; CHECK: retl
|
|
|
|
define zeroext i1 @ret_true() {
|
|
entry:
|
|
ret i1 true
|
|
}
|
|
|
|
; CHECK-LABEL: ret_true:
|
|
; CHECK: movb $1, %al
|
|
; CHECK: retl
|