Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC][GISel] add support for fpconstant
Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D133340
- Loading branch information
1 parent
5561e17
commit 6ee2f77
Showing
15 changed files
with
263 additions
and
1 deletion.
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
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
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
13 changes: 13 additions & 0 deletions
13
llvm/test/CodeGen/PowerPC/GlobalISel/fconstant-unsupported.ll
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,13 @@ | ||
; RUN: not --crash llc -global-isel -mtriple=powerpc-unknown-linux-gnu \ | ||
; RUN: -o - < %s 2>&1 | FileCheck %s --check-prefix=BE | ||
; RUN: not --crash llc -global-isel -mtriple=powerpcle-unknown-linux-gnu \ | ||
; RUN: -o - < %s 2>&1 | FileCheck %s --check-prefix=BIT32 | ||
|
||
; BE: LLVM ERROR: unable to translate in big endian mode | ||
|
||
; BIT32: LLVM ERROR: unable to legalize instruction: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD{{.*}}load (s64) from constant-pool | ||
|
||
define double @foo() { | ||
entry: | ||
ret double 1.000000e+00 | ||
} |
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,56 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
|
||
; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=small \ | ||
; RUN: -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=SMALL | ||
; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=medium \ | ||
; RUN: -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=MEDIUM | ||
; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -code-model=large \ | ||
; RUN: -verify-machineinstrs -o - < %s | FileCheck %s --check-prefix=LARGE | ||
|
||
define float @foo_float() { | ||
; SMALL-LABEL: foo_float: | ||
; SMALL: # %bb.0: # %entry | ||
; SMALL-NEXT: ld 3, .LC0@toc(2) | ||
; SMALL-NEXT: lfs 1, 0(3) | ||
; SMALL-NEXT: blr | ||
; | ||
; MEDIUM-LABEL: foo_float: | ||
; MEDIUM: # %bb.0: # %entry | ||
; MEDIUM-NEXT: addis 3, 2, .LCPI0_0@toc@ha | ||
; MEDIUM-NEXT: addi 3, 3, .LCPI0_0@toc@l | ||
; MEDIUM-NEXT: lfs 1, 0(3) | ||
; MEDIUM-NEXT: blr | ||
; | ||
; LARGE-LABEL: foo_float: | ||
; LARGE: # %bb.0: # %entry | ||
; LARGE-NEXT: addis 3, 2, .LC0@toc@ha | ||
; LARGE-NEXT: ld 3, .LC0@toc@l(3) | ||
; LARGE-NEXT: lfs 1, 0(3) | ||
; LARGE-NEXT: blr | ||
entry: | ||
ret float 1.000000e+00 | ||
} | ||
|
||
define double @foo_double() { | ||
; SMALL-LABEL: foo_double: | ||
; SMALL: # %bb.0: # %entry | ||
; SMALL-NEXT: ld 3, .LC1@toc(2) | ||
; SMALL-NEXT: lfd 1, 0(3) | ||
; SMALL-NEXT: blr | ||
; | ||
; MEDIUM-LABEL: foo_double: | ||
; MEDIUM: # %bb.0: # %entry | ||
; MEDIUM-NEXT: addis 3, 2, .LCPI1_0@toc@ha | ||
; MEDIUM-NEXT: addi 3, 3, .LCPI1_0@toc@l | ||
; MEDIUM-NEXT: lfd 1, 0(3) | ||
; MEDIUM-NEXT: blr | ||
; | ||
; LARGE-LABEL: foo_double: | ||
; LARGE: # %bb.0: # %entry | ||
; LARGE-NEXT: addis 3, 2, .LC1@toc@ha | ||
; LARGE-NEXT: ld 3, .LC1@toc@l(3) | ||
; LARGE-NEXT: lfd 1, 0(3) | ||
; LARGE-NEXT: blr | ||
entry: | ||
ret double 1.000000e+00 | ||
} |
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,40 @@ | ||
# RUN: not --crash llc -o - -march=arm64 -global-isel -run-pass=none \ | ||
# RUN: -verify-machineinstrs %s 2>&1 | FileCheck %s | ||
# REQUIRES: aarch64-registered-target | ||
|
||
--- | ||
name: test_constant_pool | ||
constants: | ||
- id: 0 | ||
value: 'double 3.250000e+00' | ||
stack: | ||
- { id: 0, size: 64, alignment: 8 } | ||
legalized: true | ||
regBankSelected: false | ||
selected: false | ||
tracksRegLiveness: true | ||
liveins: | ||
body: | | ||
bb.0: | ||
; CHECK: Bad machine code: Too few operands | ||
%0:_(p0) = G_CONSTANT_POOL | ||
; CHECK: Bad machine code: Src operand 1 must be a constant pool index | ||
%1:_(p0) = G_CONSTANT_POOL 1 | ||
; CHECK: Bad machine code: Src operand 1 must be a constant pool index | ||
%2:_(p0) = G_CONSTANT_POOL i32 1 | ||
; CHECK: Bad machine code: Src operand 1 must be a constant pool index | ||
%3:_(p0) = G_CONSTANT_POOL %stack.0 | ||
; CHECK: Dst operand 0 must be a pointer | ||
%4:_(s32) = G_CONSTANT_POOL %const.0 | ||
; CHECK: Dst operand 0 must be a pointer | ||
%5:_(s64) = G_CONSTANT_POOL %const.0 | ||
; CHECK-NOT: %6 | ||
%6:_(p0) = G_CONSTANT_POOL %const.0 | ||
... |