Chromium Code Reviews| Index: tests_lit/assembler/x86/immediate_encodings.ll |
| diff --git a/tests_lit/assembler/x86/immediate_encodings.ll b/tests_lit/assembler/x86/immediate_encodings.ll |
| index 2a9fcb47329c55a71ac80b672c31043df79541d9..a80fe5b0597ca1ac4a7f3958a906042721fdb977 100644 |
| --- a/tests_lit/assembler/x86/immediate_encodings.ll |
| +++ b/tests_lit/assembler/x86/immediate_encodings.ll |
| @@ -44,6 +44,67 @@ entry: |
| ; CHECK-LABEL: testXor8Imm8NotEAX |
| ; CHECK: 80 f{{[1-3]}} 7f xor {{[^a]}}l, 127 |
| +define internal i32 @testXor16Imm8(i32 %arg) { |
| +entry: |
| + %arg_i16 = trunc i32 %arg to i16 |
| + %result_i16 = xor i16 %arg_i16, 127 |
| + %result = zext i16 %result_i16 to i32 |
| + ret i32 %result |
| +} |
| +; CHECK-LABEL: testXor16Imm8 |
| +; CHECK: 66 83 f0 7f xor ax, 127 |
| + |
| +define internal i32 @testXor16Imm8Neg(i32 %arg) { |
| +entry: |
| + %arg_i16 = trunc i32 %arg to i16 |
| + %result_i16 = xor i16 %arg_i16, -128 |
| + %result = zext i16 %result_i16 to i32 |
| + ret i32 %result |
| +} |
| +; CHECK-LABEL: testXor16Imm8Neg |
| +; CHECK: 66 83 f0 80 xor ax, 128 |
| + |
| +define internal i32 @testXor16Imm16Eax(i32 %arg) { |
| +entry: |
| + %arg_i16 = trunc i32 %arg to i16 |
| + %tmp = xor i16 %arg_i16, 1024 |
| + %result_i16 = add i16 %tmp, 1 |
| + %result = zext i16 %result_i16 to i32 |
| + ret i32 %result |
| +} |
| +; CHECK-LABEL: testXor16Imm16Eax |
| +; CHECK: 66 35 00 04 xor ax, 1024 |
| +; CHECK-NEXT: add ax, 1 |
| + |
| +define internal i32 @testXor16Imm16NegEax(i32 %arg) { |
| +entry: |
| + %arg_i16 = trunc i32 %arg to i16 |
| + %tmp = xor i16 %arg_i16, -256 |
| + %result_i16 = add i16 %tmp, 1 |
| + %result = zext i16 %result_i16 to i32 |
| + ret i32 %result |
| +} |
| +; CHECK-LABEL: testXor16Imm16NegEax |
| +; CHECK: 66 35 00 ff xor ax, 65280 |
|
Jim Stichnoth
2014/09/28 18:14:28
Oddly, this part works correctly in master.
jvoung (off chromium)
2014/09/29 01:16:56
I think that llvm-objdump semi-silently ignored th
|
| +; CHECK-NEXT: add ax, 1 |
| + |
| +define internal i32 @testXor16Imm16NotEAX(i32 %arg_i32, i32 %arg2_i32, i32 %arg3_i32) { |
| +entry: |
| + %arg = trunc i32 %arg_i32 to i16 |
| + %arg2 = trunc i32 %arg2_i32 to i16 |
| + %arg3 = trunc i32 %arg3_i32 to i16 |
| + %x = xor i16 %arg, 32767 |
| + %x2 = xor i16 %arg2, 32767 |
| + %x3 = xor i16 %arg3, 32767 |
| + %add1 = add i16 %x, %x2 |
| + %add2 = add i16 %add1, %x3 |
| + %result = zext i16 %add2 to i32 |
| + ret i32 %result |
| +} |
| +; CHECK-LABEL: testXor16Imm16NotEAX |
| +; CHECK: 66 81 f{{[1-3]}} ff 7f xor {{[^a]}}x, 32767 |
| +; CHECK-NEXT: 66 81 f{{[1-3]}} ff 7f xor {{[^a]}}x, 32767 |
| + |
| define internal i32 @testXor32Imm8(i32 %arg) { |
| entry: |
| %result = xor i32 %arg, 127 |