1 ; RUN: llc -march=mips -mcpu=mips32 < %s | FileCheck %s --check-prefixes=ALL,BE
2 ; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s --check-prefixes=ALL,LE
4 ; Verify visitTRUNCATE respects endianness when transforming trunc to insert_vector_elt.
10 define i32 @a(ptr %a) {
12 %0 = load <2 x i32>, ptr %a
13 %1 = bitcast <2 x i32> %0 to i64
14 %2 = trunc i64 %1 to i32
22 define i32 @b(ptr %a) {
24 %0 = load <4 x i32>, ptr %a
25 %1 = bitcast <4 x i32> %0 to i128
26 %2 = trunc i128 %1 to i32
31 ; Verify visitEXTRACT_VECTOR_ELT respects endianness when transforming extract_vector_elt to a trunc.
37 define i32 @c(ptr %a) {
40 %1 = bitcast i64 %0 to <2 x i32>
41 %2 = extractelement <2 x i32> %1, i32 0
49 define i32 @d(ptr %a) {
52 %1 = bitcast i64 %0 to <2 x i32>
53 %2 = extractelement <2 x i32> %1, i32 1