1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=corei7 | FileCheck %s
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 %union.anon = type { <2 x i8> }
9 @i = dso_local global <2 x i8> <i8 150, i8 100>, align 8
10 @j = dso_local global <2 x i8> <i8 10, i8 13>, align 8
11 @res = common dso_local global %union.anon zeroinitializer, align 8
13 ; Make sure we load the constants i and j starting offset zero.
14 ; Also make sure that we sign-extend it.
15 ; Based on /gcc-4_2-testsuite/src/gcc.c-torture/execute/pr23135.c
17 define dso_local i32 @main() nounwind uwtable {
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: movl i(%rip), %esi
21 ; CHECK-NEXT: movl j(%rip), %eax
22 ; CHECK-NEXT: movl %esi, %edx
23 ; CHECK-NEXT: shrl $8, %edx
24 ; CHECK-NEXT: movsbl %al, %ecx
25 ; CHECK-NEXT: shrl $8, %eax
27 ; CHECK-NEXT: idivb %dl
28 ; CHECK-NEXT: movl %eax, %edx
29 ; CHECK-NEXT: movl %ecx, %eax
30 ; CHECK-NEXT: idivb %sil
31 ; CHECK-NEXT: movzbl %dl, %ecx
32 ; CHECK-NEXT: movzbl %al, %eax
33 ; CHECK-NEXT: movd %eax, %xmm0
34 ; CHECK-NEXT: pinsrb $1, %ecx, %xmm0
35 ; CHECK-NEXT: pextrw $0, %xmm0, res(%rip)
36 ; CHECK-NEXT: xorl %eax, %eax
39 %0 = load <2 x i8>, ptr @i, align 8
40 %1 = load <2 x i8>, ptr @j, align 8
41 %div = sdiv <2 x i8> %1, %0
42 store <2 x i8> %div, ptr @res, align 8