Benjamin Kramer | 07265b8 | 2010-12-18 14:07:28 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86 -mcpu=nehalem | FileCheck %s |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 2 | |
Benjamin Kramer | edb7fe5 | 2010-12-18 14:23:57 +0000 | [diff] [blame] | 3 | define <4 x i32> @signd(<4 x i32> %a, <4 x i32> %b) nounwind { |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 4 | entry: |
Benjamin Kramer | edb7fe5 | 2010-12-18 14:23:57 +0000 | [diff] [blame] | 5 | ; CHECK: signd: |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 6 | ; CHECK: psignd |
| 7 | ; CHECK-NOT: sub |
Benjamin Kramer | 07265b8 | 2010-12-18 14:07:28 +0000 | [diff] [blame] | 8 | ; CHECK: ret |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 9 | %b.lobit = ashr <4 x i32> %b, <i32 31, i32 31, i32 31, i32 31> |
| 10 | %sub = sub nsw <4 x i32> zeroinitializer, %a |
| 11 | %0 = xor <4 x i32> %b.lobit, <i32 -1, i32 -1, i32 -1, i32 -1> |
| 12 | %1 = and <4 x i32> %a, %0 |
| 13 | %2 = and <4 x i32> %b.lobit, %sub |
| 14 | %cond = or <4 x i32> %1, %2 |
| 15 | ret <4 x i32> %cond |
| 16 | } |
| 17 | |
Benjamin Kramer | edb7fe5 | 2010-12-18 14:23:57 +0000 | [diff] [blame] | 18 | define <4 x i32> @blendvb(<4 x i32> %b, <4 x i32> %a, <4 x i32> %c) nounwind { |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 19 | entry: |
Benjamin Kramer | edb7fe5 | 2010-12-18 14:23:57 +0000 | [diff] [blame] | 20 | ; CHECK: blendvb: |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 21 | ; CHECK: pblendvb |
Benjamin Kramer | 07265b8 | 2010-12-18 14:07:28 +0000 | [diff] [blame] | 22 | ; CHECK: ret |
Nate Begeman | b65c175 | 2010-12-17 22:55:37 +0000 | [diff] [blame] | 23 | %b.lobit = ashr <4 x i32> %b, <i32 31, i32 31, i32 31, i32 31> |
| 24 | %sub = sub nsw <4 x i32> zeroinitializer, %a |
| 25 | %0 = xor <4 x i32> %b.lobit, <i32 -1, i32 -1, i32 -1, i32 -1> |
| 26 | %1 = and <4 x i32> %c, %0 |
| 27 | %2 = and <4 x i32> %a, %b.lobit |
| 28 | %cond = or <4 x i32> %1, %2 |
| 29 | ret <4 x i32> %cond |
| 30 | } |