-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Atomic loads/stores, spill/reload, tests for __fp16 and half vectors.
- Loading branch information
Showing
14 changed files
with
1,297 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %clang_cc1 -triple s390x-linux-gnu -emit-llvm -o - %s \ | ||
// RUN: | FileCheck %s | ||
|
||
__fp16 f(__fp16 a, __fp16 b, __fp16 c, __fp16 d) { | ||
return a * b + c * d; | ||
} | ||
|
||
// CHECK-LABEL: define dso_local half @f(half noundef %a, half noundef %b, half noundef %c, half noundef %d) #0 { | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: %a.addr = alloca half, align 2 | ||
// CHECK-NEXT: %b.addr = alloca half, align 2 | ||
// CHECK-NEXT: %c.addr = alloca half, align 2 | ||
// CHECK-NEXT: %d.addr = alloca half, align 2 | ||
// CHECK-NEXT: store half %a, ptr %a.addr, align 2 | ||
// CHECK-NEXT: store half %b, ptr %b.addr, align 2 | ||
// CHECK-NEXT: store half %c, ptr %c.addr, align 2 | ||
// CHECK-NEXT: store half %d, ptr %d.addr, align 2 | ||
// CHECK-NEXT: %0 = load half, ptr %a.addr, align 2 | ||
// CHECK-NEXT: %conv = fpext half %0 to float | ||
// CHECK-NEXT: %1 = load half, ptr %b.addr, align 2 | ||
// CHECK-NEXT: %conv1 = fpext half %1 to float | ||
// CHECK-NEXT: %mul = fmul float %conv, %conv1 | ||
// CHECK-NEXT: %2 = load half, ptr %c.addr, align 2 | ||
// CHECK-NEXT: %conv2 = fpext half %2 to float | ||
// CHECK-NEXT: %3 = load half, ptr %d.addr, align 2 | ||
// CHECK-NEXT: %conv3 = fpext half %3 to float | ||
// CHECK-NEXT: %mul4 = fmul float %conv2, %conv3 | ||
// CHECK-NEXT: %add = fadd float %mul, %mul4 | ||
// CHECK-NEXT: %4 = fptrunc float %add to half | ||
// CHECK-NEXT: ret half %4 | ||
// CHECK-NEXT: } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; Test fp16 atomic loads. | ||
; | ||
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s | ||
|
||
define half @f1(ptr %src) { | ||
; CHECK-LABEL: f1: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: lh %r0, 0(%r2) | ||
; CHECK-NEXT: sllg %r0, %r0, 48 | ||
; CHECK-NEXT: ldgr %f0, %r0 | ||
; CHECK-NEXT: # kill: def $f0h killed $f0h killed $f0d | ||
; CHECK-NEXT: br %r14 | ||
%val = load atomic half, ptr %src seq_cst, align 2 | ||
ret half %val | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; Test half atomic stores. | ||
; | ||
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s | ||
|
||
define void @f1(ptr %src, half %val) { | ||
; CHECK-LABEL: f1: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: # kill: def $f0h killed $f0h def $f0d | ||
; CHECK-NEXT: lgdr %r0, %f0 | ||
; CHECK-NEXT: srlg %r0, %r0, 48 | ||
; CHECK-NEXT: sth %r0, 0(%r2) | ||
; CHECK-NEXT: bcr 15, %r0 | ||
; CHECK-NEXT: br %r14 | ||
store atomic half %val, ptr %src seq_cst, align 2 | ||
ret void | ||
} |
Oops, something went wrong.