-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARM big endian function argument passing
llvm-svn: 208316
- Loading branch information
Christian Pirker
committed
May 8, 2014
1 parent
6dc9c48
commit b572819
Showing
9 changed files
with
412 additions
and
140 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,124 @@ | ||
; RUN: llc -verify-machineinstrs < %s -march=arm -mattr=v7,neon | FileCheck --check-prefix=CHECK --check-prefix=CHECK-LE %s | ||
; RUN: llc -verify-machineinstrs < %s -march=armeb -mattr=v7,neon | FileCheck --check-prefix=CHECK --check-prefix=CHECK-BE %s | ||
|
||
@var32 = global i32 0 | ||
@vardouble = global double 0.0 | ||
|
||
define void @arg_longint( i64 %val ) { | ||
; CHECK-LABEL: arg_longint: | ||
; CHECK-LE: str r0, [r1] | ||
; CHECK-BE: str r1, [r0] | ||
%tmp = trunc i64 %val to i32 | ||
store i32 %tmp, i32* @var32 | ||
ret void | ||
} | ||
|
||
define void @arg_double( double %val ) { | ||
; CHECK-LABEL: arg_double: | ||
; CHECK: strd r0, r1, [r2] | ||
store double %val, double* @vardouble | ||
ret void | ||
} | ||
|
||
define void @arg_v4i32(<4 x i32> %vec ) { | ||
; CHECK-LABEL: arg_v4i32: | ||
; CHECK-LE: vmov d17, r2, r3 | ||
; CHECK-LE: vmov d16, r0, r1 | ||
; CHECK-BE: vmov d17, r3, r2 | ||
; CHECK-BE: vmov d16, r1, r0 | ||
; CHECK: vst1.32 {d16[0]}, [r0:32] | ||
%tmp = extractelement <4 x i32> %vec, i32 0 | ||
store i32 %tmp, i32* @var32 | ||
ret void | ||
} | ||
|
||
define void @arg_v2f64(<2 x double> %vec ) { | ||
; CHECK-LABEL: arg_v2f64: | ||
; CHECK: strd r0, r1, [r2] | ||
%tmp = extractelement <2 x double> %vec, i32 0 | ||
store double %tmp, double* @vardouble | ||
ret void | ||
} | ||
|
||
define i64 @return_longint() { | ||
; CHECK-LABEL: return_longint: | ||
; CHECK-LE: mov r0, #42 | ||
; CHECK-LE: mov r1, #0 | ||
; CHECK-BE: mov r0, #0 | ||
; CHECK-BE: mov r1, #42 | ||
ret i64 42 | ||
} | ||
|
||
define double @return_double() { | ||
; CHECK-LABEL: return_double: | ||
; CHECK-LE: vmov r0, r1, d16 | ||
; CHECK-BE: vmov r1, r0, d16 | ||
ret double 1.0 | ||
} | ||
|
||
define <4 x i32> @return_v4i32() { | ||
; CHECK-LABEL: return_v4i32: | ||
; CHECK-LE: vmov r0, r1, d16 | ||
; CHECK-LE: vmov r2, r3, d17 | ||
; CHECK-BE: vmov r1, r0, d16 | ||
; CHECK-BE: vmov r3, r2, d17 | ||
ret < 4 x i32> < i32 42, i32 43, i32 44, i32 45 > | ||
} | ||
|
||
define <2 x double> @return_v2f64() { | ||
; CHECK-LABEL: return_v2f64: | ||
; CHECK-LE: vmov r0, r1, d16 | ||
; CHECK-LE: vmov r2, r3, d17 | ||
; CHECK-BE: vmov r1, r0, d16 | ||
; CHECK-BE: vmov r3, r2, d17 | ||
ret <2 x double> < double 3.14, double 6.28 > | ||
} | ||
|
||
define void @caller_arg_longint() { | ||
; CHECK-LABEL: caller_arg_longint: | ||
; CHECK-LE: mov r0, #42 | ||
; CHECK-LE: mov r1, #0 | ||
; CHECK-BE: mov r0, #0 | ||
; CHECK-BE: mov r1, #42 | ||
call void @arg_longint( i64 42 ) | ||
ret void | ||
} | ||
|
||
define void @caller_arg_double() { | ||
; CHECK-LABEL: caller_arg_double: | ||
; CHECK-LE: vmov r0, r1, d16 | ||
; CHECK-BE: vmov r1, r0, d16 | ||
call void @arg_double( double 1.0 ) | ||
ret void | ||
} | ||
|
||
define void @caller_return_longint() { | ||
; CHECK-LABEL: caller_return_longint: | ||
; CHECK-LE: str r0, [r1] | ||
; CHECK-BE: str r1, [r0] | ||
%val = call i64 @return_longint() | ||
%tmp = trunc i64 %val to i32 | ||
store i32 %tmp, i32* @var32 | ||
ret void | ||
} | ||
|
||
define void @caller_return_double() { | ||
; CHECK-LABEL: caller_return_double: | ||
; CHECK-LE: vmov d17, r0, r1 | ||
; CHECK-BE: vmov d17, r1, r0 | ||
%val = call double @return_double( ) | ||
%tmp = fadd double %val, 3.14 | ||
store double %tmp, double* @vardouble | ||
ret void | ||
} | ||
|
||
define void @caller_return_v2f64() { | ||
; CHECK-LABEL: caller_return_v2f64: | ||
; CHECK: strd r0, r1, [r2] | ||
%val = call <2 x double> @return_v2f64( ) | ||
%tmp = extractelement <2 x double> %val, i32 0 | ||
store double %tmp, double* @vardouble | ||
ret void | ||
} | ||
|
||
|
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