-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] Implement DFP add and sub instructions.
Add the following Decimal Floating Point (DFP) instructions for PowerPC. dadd, daddq, dsub, dsubq In order to add these instructions a new register class for a pair of floating point registers is added. This patch is only to allow the user to specify the instructions in assembly. There is no scheduling or patterns for the instructions. Reviewed By: amyk Differential Revision: https://reviews.llvm.org/D148597
- Loading branch information
1 parent
7dc5635
commit c74aec9
Showing
10 changed files
with
177 additions
and
38 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
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,28 @@ | ||
//===-- PPCInstrDFP.td - PowerPC Decimal Floating Point ----*- tablegen -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file describes the PowerPC Decimal Floating Point (DFP) instructions. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// We provide no scheduling info for the DFP instructions. | ||
// While they are not pseudo instructions we don't intend on scheduling them. | ||
let hasNoSchedulingInfo = 1 in { | ||
defm DADD : XForm_28r<59, 2, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB), | ||
"dadd", "$RST, $RA, $RB", IIC_FPGeneral, []>; | ||
|
||
defm DADDQ : XForm_28r<63, 2, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB), | ||
"daddq", "$RST, $RA, $RB", IIC_FPGeneral, []>; | ||
|
||
defm DSUB : XForm_28r<59, 514, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB), | ||
"dsub", "$RST, $RA, $RB", IIC_FPGeneral, []>; | ||
|
||
defm DSUBQ : XForm_28r<63, 514, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB), | ||
"dsubq", "$RST, $RA, $RB", IIC_FPGeneral, []>; | ||
} | ||
|
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,25 @@ | ||
# RUN: llvm-mc --disassemble %s -triple powerpc64-unknown-unknown -mcpu=pwr7 | FileCheck %s | ||
|
||
# CHECK: dadd 2, 3, 4 | ||
0xec 0x43 0x20 0x04 | ||
|
||
# CHECK: dadd. 2, 3, 4 | ||
0xec 0x43 0x20 0x05 | ||
|
||
# CHECK: daddq 2, 6, 4 | ||
0xfc 0x46 0x20 0x04 | ||
|
||
# CHECK: daddq. 2, 6, 4 | ||
0xfc 0x46 0x20 0x05 | ||
|
||
# CHECK: dsub 2, 3, 4 | ||
0xec 0x43 0x24 0x04 | ||
|
||
# CHECK: dsub. 2, 3, 4 | ||
0xec 0x43 0x24 0x05 | ||
|
||
# CHECK: dsubq 2, 6, 4 | ||
0xfc 0x46 0x24 0x04 | ||
|
||
# CHECK: dsubq. 2, 6, 4 | ||
0xfc 0x46 0x24 0x05 |
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,28 @@ | ||
# RUN: llvm-mc -triple powerpc64-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-BE %s | ||
# RUN: llvm-mc -triple powerpc64le-unknown-unknown --show-encoding %s | FileCheck -check-prefix=CHECK-LE %s | ||
|
||
|
||
# CHECK-BE: dadd 2, 3, 4 # encoding: [0xec,0x43,0x20,0x04] | ||
# CHECK-LE: dadd 2, 3, 4 # encoding: [0x04,0x20,0x43,0xec] | ||
dadd 2, 3, 4 | ||
# CHECK-BE: dadd. 2, 3, 4 # encoding: [0xec,0x43,0x20,0x05] | ||
# CHECK-LE: dadd. 2, 3, 4 # encoding: [0x05,0x20,0x43,0xec] | ||
dadd. 2, 3, 4 | ||
# CHECK-BE: daddq 2, 6, 4 # encoding: [0xfc,0x46,0x20,0x04] | ||
# CHECK-LE: daddq 2, 6, 4 # encoding: [0x04,0x20,0x46,0xfc] | ||
daddq 2, 6, 4 | ||
# CHECK-BE: daddq. 2, 6, 4 # encoding: [0xfc,0x46,0x20,0x05] | ||
# CHECK-LE: daddq. 2, 6, 4 # encoding: [0x05,0x20,0x46,0xfc] | ||
daddq. 2, 6, 4 | ||
# CHECK-BE: dsub 2, 3, 4 # encoding: [0xec,0x43,0x24,0x04] | ||
# CHECK-LE: dsub 2, 3, 4 # encoding: [0x04,0x24,0x43,0xec] | ||
dsub 2, 3, 4 | ||
# CHECK-BE: dsub. 2, 3, 4 # encoding: [0xec,0x43,0x24,0x05] | ||
# CHECK-LE: dsub. 2, 3, 4 # encoding: [0x05,0x24,0x43,0xec] | ||
dsub. 2, 3, 4 | ||
# CHECK-BE: dsubq 2, 6, 4 # encoding: [0xfc,0x46,0x24,0x04] | ||
# CHECK-LE: dsubq 2, 6, 4 # encoding: [0x04,0x24,0x46,0xfc] | ||
dsubq 2, 6, 4 | ||
# CHECK-BE: dsubq. 2, 6, 4 # encoding: [0xfc,0x46,0x24,0x05] | ||
# CHECK-LE: dsubq. 2, 6, 4 # encoding: [0x05,0x24,0x46,0xfc] | ||
dsubq. 2, 6, 4 |