~pali/llvm/clang-3.5

« back to all changes in this revision

Viewing changes to test/CodeGen/mips-vector-return.c

  • Committer: dsanders
  • Date: 2014-12-01 10:07:55 UTC
  • Revision ID: svn-v4:91177308-0d34-0410-b5e6-96231b3b80d8:cfe/branches/release_35:222998
Merging r217160:

[mips] Mark aggregates returned in registers with the 'inreg' attribute.

Summary:
This allows us to easily find them in the backend after the aggregates have
been lowered to other types. This is important on big-endian targets using
the N32/N64 ABI's since these ABI's must shift small structures into the
upper bits of the register.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5005

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
typedef int v4i32 __attribute__ ((__vector_size__ (16)));
10
10
 
11
11
// O32-LABEL: define void @test_v4sf(<4 x float>* noalias nocapture sret
12
 
// N64: define { i64, i64 } @test_v4sf
 
12
// N64: define inreg { i64, i64 } @test_v4sf
13
13
v4sf test_v4sf(float a) {
14
14
  return (v4sf){0.0f, a, 0.0f, 0.0f};
15
15
}
23
23
// O32 returns integer vectors whose size is equal to or smaller than 16-bytes
24
24
// in integer registers.
25
25
//
26
 
// O32: define { i32, i32, i32, i32 } @test_v4i32
27
 
// N64: define { i64, i64 } @test_v4i32
 
26
// O32: define inreg { i32, i32, i32, i32 } @test_v4i32
 
27
// N64: define inreg { i64, i64 } @test_v4i32
28
28
v4i32 test_v4i32(int a) {
29
29
  return (v4i32){0, a, 0, 0};
30
30
}