Rafael Espindola | 494a381 | 2015-07-17 00:57:52 +0000 | [diff] [blame] | 1 | ; RUN: llc -show-mc-encoding < %s | FileCheck %s |
| 2 | |
| 3 | ; Test that the direct object emission selects the and variant with 8 bit |
| 4 | ; immediate. |
| 5 | ; We used to get this wrong when using direct object emission, but not when |
| 6 | ; reading assembly. |
| 7 | |
| 8 | |
| 9 | target triple = "x86_64-pc-linux" |
| 10 | |
| 11 | define void @f1() { |
| 12 | ; CHECK-LABEL: f1: |
| 13 | ; CHECK: andq $-32, %rsp # encoding: [0x48,0x83,0xe4,0xe0] |
| 14 | %foo = alloca i8, align 32 |
| 15 | ret void |
| 16 | } |
| 17 | |
Elena Demikhovsky | e5bbca6 | 2016-02-25 07:05:12 +0000 | [diff] [blame] | 18 | define void @f2(i16 %x, i1 *%y) { |
Rafael Espindola | 494a381 | 2015-07-17 00:57:52 +0000 | [diff] [blame] | 19 | ; CHECK-LABEL: f2: |
Elena Demikhovsky | e5bbca6 | 2016-02-25 07:05:12 +0000 | [diff] [blame] | 20 | ; CHECK: andl $1, %edi # encoding: [0x83,0xe7,0x01] |
| 21 | %c = trunc i16 %x to i1 |
| 22 | store i1 %c, i1* %y |
Rafael Espindola | 494a381 | 2015-07-17 00:57:52 +0000 | [diff] [blame] | 23 | ret void |
| 24 | } |
| 25 | |
Elena Demikhovsky | e5bbca6 | 2016-02-25 07:05:12 +0000 | [diff] [blame] | 26 | define void @f3(i32 %x, i1 *%y) { |
Rafael Espindola | 494a381 | 2015-07-17 00:57:52 +0000 | [diff] [blame] | 27 | ; CHECK-LABEL: f3: |
Elena Demikhovsky | e5bbca6 | 2016-02-25 07:05:12 +0000 | [diff] [blame] | 28 | ; CHECK: andl $1, %edi # encoding: [0x83,0xe7,0x01] |
| 29 | %c = trunc i32 %x to i1 |
| 30 | store i1 %c, i1* %y |
| 31 | ret void |
Rafael Espindola | 494a381 | 2015-07-17 00:57:52 +0000 | [diff] [blame] | 32 | } |