-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mips] Fix passing of small structures for big-endian O32.
Summary: Like N32/N64, they must be passed in the upper bits of the register. The new code could be merged with the existing if-statements but I've refrained from doing this since it will make porting the O32 implementation to tablegen harder later. Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6463 llvm-svn: 223148
- Loading branch information
1 parent
7e6b595
commit d134c9d
Showing
2 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
; RUN: llc -march=mips -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-BE %s | ||
; RUN: llc -march=mipsel -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-LE %s | ||
|
||
; RUN-TODO: llc -march=mips64 -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-BE %s | ||
; RUN-TODO: llc -march=mips64el -relocation-model=static -mattr=-n64,+o32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-LE %s | ||
|
||
; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=NEW-BE %s | ||
; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=NEW-LE %s | ||
|
||
; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM64 --check-prefix=NEW-BE %s | ||
; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM64 --check-prefix=NEW-LE %s | ||
|
||
; Test small structures for all ABI's and byte orders. | ||
; | ||
; N32/N64 are identical in this area so their checks have been combined into | ||
; the 'NEW' prefix (the N stands for New). | ||
|
||
@bytes = global [2 x i8] zeroinitializer | ||
|
||
define void @s_i8(i8 inreg %a) nounwind { | ||
entry: | ||
store i8 %a, i8* getelementptr inbounds ([2 x i8]* @bytes, i32 0, i32 1) | ||
ret void | ||
} | ||
|
||
; ALL-LABEL: s_i8: | ||
|
||
; SYM32-DAG: lui [[PTR_HI:\$[0-9]+]], %hi(bytes) | ||
; SYM32-DAG: addiu [[PTR:\$[0-9]+]], [[PTR_HI]], %lo(bytes) | ||
|
||
; SYM64-DAG: ld [[PTR:\$[0-9]+]], %got_disp(bytes)( | ||
|
||
; O32-BE-DAG: srl [[ARG:\$[0-9]+]], $4, 24 | ||
; O32-BE-DAG: sb [[ARG]], 1([[PTR]]) | ||
|
||
; O32-LE-DAG: sb $4, 1([[PTR]]) | ||
|
||
; NEW-BE-DAG: dsrl [[ARG:\$[0-9]+]], $4, 56 | ||
; NEW-BE-DAG: sb [[ARG]], 1([[PTR]]) | ||
|
||
; NEW-LE-DAG: sb $4, 1([[PTR]]) |