Skip to content

Commit

Permalink
[ARM64] Properly support both apple and standard syntax for FMOV
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205896 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
brads55 committed Apr 9, 2014
1 parent cb9ca90 commit c669ad9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
21 changes: 10 additions & 11 deletions lib/Target/ARM64/ARM64InstrFormats.td
Original file line number Diff line number Diff line change
Expand Up @@ -3277,8 +3277,10 @@ class BaseUnscaledConversion<bits<2> rmode, bits<3> opcode,

let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in
class BaseUnscaledConversionToHigh<bits<2> rmode, bits<3> opcode,
RegisterClass srcType, RegisterOperand dstType, string asm>
: I<(outs dstType:$Rd), (ins srcType:$Rn), asm, "\t$Rd[1], $Rn", "", []>,
RegisterClass srcType, RegisterOperand dstType, string asm,
string kind>
: I<(outs dstType:$Rd), (ins srcType:$Rn), asm,
"{\t$Rd"#kind#"[1], $Rn|"#kind#"\t$Rd[1], $Rn}", "", []>,
Sched<[WriteFCopy]> {
bits<5> Rd;
bits<5> Rn;
Expand All @@ -3293,8 +3295,10 @@ class BaseUnscaledConversionToHigh<bits<2> rmode, bits<3> opcode,

let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in
class BaseUnscaledConversionFromHigh<bits<2> rmode, bits<3> opcode,
RegisterOperand srcType, RegisterClass dstType, string asm>
: I<(outs dstType:$Rd), (ins srcType:$Rn), asm, "\t$Rd, $Rn[1]", "", []>,
RegisterOperand srcType, RegisterClass dstType, string asm,
string kind>
: I<(outs dstType:$Rd), (ins srcType:$Rn), asm,
"{\t$Rd, $Rn"#kind#"[1]|"#kind#"\t$Rd, $Rn[1]}", "", []>,
Sched<[WriteFCopy]> {
bits<5> Rd;
bits<5> Rn;
Expand Down Expand Up @@ -3331,21 +3335,16 @@ multiclass UnscaledConversion<string asm> {
}

def XDHighr : BaseUnscaledConversionToHigh<0b01, 0b111, GPR64, V128,
asm#".d"> {
asm, ".d"> {
let Inst{31} = 1;
let Inst{22} = 0;
}

def DXHighr : BaseUnscaledConversionFromHigh<0b01, 0b110, V128, GPR64,
asm#".d"> {
asm, ".d"> {
let Inst{31} = 1;
let Inst{22} = 0;
}

def : InstAlias<asm#"$Vd.d[1], $Rn",
(!cast<Instruction>(NAME#XDHighr) V128:$Vd, GPR64:$Rn), 0>;
def : InstAlias<asm#"$Rd, $Vn.d[1]",
(!cast<Instruction>(NAME#DXHighr) GPR64:$Rd, V128:$Vn), 0>;
}

//---
Expand Down
2 changes: 1 addition & 1 deletion test/MC/ARM64/fp-encoding.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding -output-asm-variant=1 < %s | FileCheck %s

foo:
;-----------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions test/MC/Disassembler/ARM64/non-apple-fmov.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# RUN: llvm-mc -triple arm64 -disassemble < %s | FileCheck %s

0x00 0x00 0xae 0x9e
0x00 0x00 0xaf 0x9e

# CHECK: fmov x0, v0.d[1]
# CHECK: fmov v0.d[1], x0
2 changes: 1 addition & 1 deletion test/MC/Disassembler/ARM64/scalar-fp.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: llvm-mc -triple arm64-apple-darwin --disassemble < %s | FileCheck %s
# RUN: llvm-mc -triple arm64-apple-darwin --disassemble -output-asm-variant=1 < %s | FileCheck %s

#-----------------------------------------------------------------------------
# Floating-point arithmetic
Expand Down

0 comments on commit c669ad9

Please sign in to comment.