|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2 |
| -; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs | FileCheck %s |
3 |
| -; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs -O0 | FileCheck %s |
| 2 | +; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,CHECK3 |
| 3 | +; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs -O0 | FileCheck %s --check-prefixes=CHECK,CHECK0 |
4 | 4 |
|
5 | 5 | define void @test1(ptr %ptr, i32 %val1) {
|
6 | 6 | ; CHECK-LABEL: test1:
|
@@ -28,3 +28,102 @@ define i32 @test3(ptr %ptr) {
|
28 | 28 | %val = load atomic i32, ptr %ptr seq_cst, align 4
|
29 | 29 | ret i32 %val
|
30 | 30 | }
|
| 31 | + |
| 32 | +define <1 x i32> @atomic_vec1_i32(ptr %x) { |
| 33 | +; CHECK-LABEL: atomic_vec1_i32: |
| 34 | +; CHECK: ## %bb.0: |
| 35 | +; CHECK-NEXT: movl (%rdi), %eax |
| 36 | +; CHECK-NEXT: retq |
| 37 | + %ret = load atomic <1 x i32>, ptr %x acquire, align 4 |
| 38 | + ret <1 x i32> %ret |
| 39 | +} |
| 40 | + |
| 41 | +define <1 x i8> @atomic_vec1_i8(ptr %x) { |
| 42 | +; CHECK3-LABEL: atomic_vec1_i8: |
| 43 | +; CHECK3: ## %bb.0: |
| 44 | +; CHECK3-NEXT: movzbl (%rdi), %eax |
| 45 | +; CHECK3-NEXT: retq |
| 46 | +; |
| 47 | +; CHECK0-LABEL: atomic_vec1_i8: |
| 48 | +; CHECK0: ## %bb.0: |
| 49 | +; CHECK0-NEXT: movb (%rdi), %al |
| 50 | +; CHECK0-NEXT: retq |
| 51 | + %ret = load atomic <1 x i8>, ptr %x acquire, align 4 |
| 52 | + ret <1 x i8> %ret |
| 53 | +} |
| 54 | + |
| 55 | +define <1 x i16> @atomic_vec1_i16(ptr %x) { |
| 56 | +; CHECK3-LABEL: atomic_vec1_i16: |
| 57 | +; CHECK3: ## %bb.0: |
| 58 | +; CHECK3-NEXT: movzwl (%rdi), %eax |
| 59 | +; CHECK3-NEXT: retq |
| 60 | +; |
| 61 | +; CHECK0-LABEL: atomic_vec1_i16: |
| 62 | +; CHECK0: ## %bb.0: |
| 63 | +; CHECK0-NEXT: movw (%rdi), %ax |
| 64 | +; CHECK0-NEXT: retq |
| 65 | + %ret = load atomic <1 x i16>, ptr %x acquire, align 4 |
| 66 | + ret <1 x i16> %ret |
| 67 | +} |
| 68 | + |
| 69 | +define <1 x i32> @atomic_vec1_i8_zext(ptr %x) { |
| 70 | +; CHECK3-LABEL: atomic_vec1_i8_zext: |
| 71 | +; CHECK3: ## %bb.0: |
| 72 | +; CHECK3-NEXT: movzbl (%rdi), %eax |
| 73 | +; CHECK3-NEXT: movzbl %al, %eax |
| 74 | +; CHECK3-NEXT: retq |
| 75 | +; |
| 76 | +; CHECK0-LABEL: atomic_vec1_i8_zext: |
| 77 | +; CHECK0: ## %bb.0: |
| 78 | +; CHECK0-NEXT: movb (%rdi), %al |
| 79 | +; CHECK0-NEXT: movzbl %al, %eax |
| 80 | +; CHECK0-NEXT: retq |
| 81 | + %ret = load atomic <1 x i8>, ptr %x acquire, align 4 |
| 82 | + %zret = zext <1 x i8> %ret to <1 x i32> |
| 83 | + ret <1 x i32> %zret |
| 84 | +} |
| 85 | + |
| 86 | +define <1 x i64> @atomic_vec1_i16_sext(ptr %x) { |
| 87 | +; CHECK3-LABEL: atomic_vec1_i16_sext: |
| 88 | +; CHECK3: ## %bb.0: |
| 89 | +; CHECK3-NEXT: movzwl (%rdi), %eax |
| 90 | +; CHECK3-NEXT: movswq %ax, %rax |
| 91 | +; CHECK3-NEXT: retq |
| 92 | +; |
| 93 | +; CHECK0-LABEL: atomic_vec1_i16_sext: |
| 94 | +; CHECK0: ## %bb.0: |
| 95 | +; CHECK0-NEXT: movw (%rdi), %ax |
| 96 | +; CHECK0-NEXT: movswq %ax, %rax |
| 97 | +; CHECK0-NEXT: retq |
| 98 | + %ret = load atomic <1 x i16>, ptr %x acquire, align 4 |
| 99 | + %sret = sext <1 x i16> %ret to <1 x i64> |
| 100 | + ret <1 x i64> %sret |
| 101 | +} |
| 102 | + |
| 103 | +define <1 x ptr addrspace(270)> @atomic_vec1_ptr270(ptr %x) { |
| 104 | +; CHECK-LABEL: atomic_vec1_ptr270: |
| 105 | +; CHECK: ## %bb.0: |
| 106 | +; CHECK-NEXT: movl (%rdi), %eax |
| 107 | +; CHECK-NEXT: retq |
| 108 | + %ret = load atomic <1 x ptr addrspace(270)>, ptr %x acquire, align 4 |
| 109 | + ret <1 x ptr addrspace(270)> %ret |
| 110 | +} |
| 111 | + |
| 112 | +define <1 x bfloat> @atomic_vec1_bfloat(ptr %x) { |
| 113 | +; CHECK3-LABEL: atomic_vec1_bfloat: |
| 114 | +; CHECK3: ## %bb.0: |
| 115 | +; CHECK3-NEXT: movzwl (%rdi), %eax |
| 116 | +; CHECK3-NEXT: pinsrw $0, %eax, %xmm0 |
| 117 | +; CHECK3-NEXT: retq |
| 118 | +; |
| 119 | +; CHECK0-LABEL: atomic_vec1_bfloat: |
| 120 | +; CHECK0: ## %bb.0: |
| 121 | +; CHECK0-NEXT: movw (%rdi), %cx |
| 122 | +; CHECK0-NEXT: ## implicit-def: $eax |
| 123 | +; CHECK0-NEXT: movw %cx, %ax |
| 124 | +; CHECK0-NEXT: ## implicit-def: $xmm0 |
| 125 | +; CHECK0-NEXT: pinsrw $0, %eax, %xmm0 |
| 126 | +; CHECK0-NEXT: retq |
| 127 | + %ret = load atomic <1 x bfloat>, ptr %x acquire, align 4 |
| 128 | + ret <1 x bfloat> %ret |
| 129 | +} |
0 commit comments