Commit 6dacbafd by Karl Schimpf

Fix translation of instruction "move" in ARM integrated assembler.

Fixes case where the ARM integrated assembler for class InstARM32Mov did not revert to using the stand-alone assembler (method emit) to generate the corresponding assembly instructions(s). This fixes last known problem with method emitIAS (other than reverting to the stand-alone assembler if not implemented). Removes use of workaround flag "-unsafe-ias". BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1448783004 .
parent 7f42a824
......@@ -50,12 +50,6 @@ cl::opt<bool> AllowIacaMarks(
"inserted. These binaries are not executable."),
cl::init(false));
cl::opt<bool> AllowUnsafeIas(
"unsafe-ias",
cl::desc("Convert (potentially broken) instructions to bytes in "
"integrated assembler."),
cl::init(false));
// This is currently needed by crosstest.py.
cl::opt<bool> AllowUninitializedGlobals(
"allow-uninitialized-globals",
......@@ -390,7 +384,6 @@ void ClFlags::resetClFlags(ClFlags &OutFlags) {
OutFlags.AllowErrorRecovery = false;
OutFlags.AllowExternDefinedSymbols = false;
OutFlags.AllowIacaMarks = false;
OutFlags.AllowUnsafeIas = false;
OutFlags.AllowUninitializedGlobals = false;
OutFlags.DataSections = false;
OutFlags.DecorateAsm = false;
......@@ -465,7 +458,6 @@ void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
OutFlags.setDisableInternal(::DisableInternal);
OutFlags.setDisableIRGeneration(::DisableIRGeneration);
OutFlags.setDisableTranslation(::DisableTranslation);
OutFlags.setAllowUnsafeIas(::AllowUnsafeIas);
OutFlags.setDumpStats(::DumpStats);
OutFlags.setEnableBlockProfile(::EnableBlockProfile);
OutFlags.setForceMemIntrinOpt(::ForceMemIntrinOpt);
......
......@@ -49,9 +49,6 @@ public:
bool getAllowIacaMarks() const { return AllowIacaMarks; }
void setAllowIacaMarks(bool NewValue) { AllowIacaMarks = NewValue; }
bool getAllowUnsafeIas() const { return AllowUnsafeIas; }
void setAllowUnsafeIas(bool NewValue) { AllowUnsafeIas = NewValue; }
bool getAllowUninitializedGlobals() const {
return AllowUninitializedGlobals;
}
......@@ -259,9 +256,6 @@ private:
bool AllowExternDefinedSymbols;
bool AllowIacaMarks;
bool AllowUninitializedGlobals;
// TODO(kschimpf): This is a temporary flag. Nuke this once the ARM integrated
// assembler is working.
bool AllowUnsafeIas;
bool DataSections;
bool DecorateAsm;
bool DisableHybridAssembly;
......
......@@ -777,7 +777,6 @@ void InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const {
return Asm->setNeedsTextFixup();
return Asm->str(Src0, Dest, getPredicate(), Func->getTarget());
}
Asm->setNeedsTextFixup();
}
void InstARM32Mov::emit(const Cfg *Func) const {
......@@ -798,14 +797,13 @@ void InstARM32Mov::emit(const Cfg *Func) const {
}
void InstARM32Mov::emitIAS(const Cfg *Func) const {
if (!Func->getContext()->getFlags().getAllowUnsafeIas())
return emitUsingTextFixup(Func);
assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type.");
auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
if (!(isMultiDest() || isMultiSource())) {
if (!(isMultiDest() || isMultiSource()))
// Must be single source/dest.
emitIASSingleDestSingleSource(Func);
}
else
Asm->setNeedsTextFixup();
if (Asm->needsTextFixup())
emitUsingTextFixup(Func);
}
......
......@@ -13,12 +13,12 @@
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -O2 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
define internal i32 @AllocBigAlign() {
%addr = alloca i8, align 32
......
......@@ -9,12 +9,12 @@
; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -Om1 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
; REQUIRES: allow_dump
......
......@@ -11,12 +11,12 @@
; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -Om1 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
define internal i32 @add1ToR0(i32 %p) {
%v = add i32 %p, 1
......
......@@ -12,12 +12,12 @@
; RUN: --args -Om1 --test-stack-extra 4084 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
; RUN: --test-stack-extra 4084 | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -Om1 -unsafe-ias --test-stack-extra 4084 \
; RUN: --args -Om1 --test-stack-extra 4084 \
; RUN: | FileCheck %s --check-prefix=DIS
define internal i32 @foo(i32 %x) {
......
......@@ -11,12 +11,12 @@
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -O2 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
define internal i32 @Imm1() {
ret i32 1
......
......@@ -13,12 +13,12 @@
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -O2 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
define internal i32 @MulTwoRegs(i32 %a, i32 %b) {
%v = mul i32 %a, %b
......
......@@ -14,12 +14,12 @@
; RUN: --args -O2 -allow-extern | FileCheck %s --check-prefix=DIS
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 -unsafe-ias \
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
; RUN: -allow-extern | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -O2 -unsafe-ias -allow-extern | FileCheck %s --check-prefix=DIS
; RUN: --args -O2 -allow-extern | FileCheck %s --check-prefix=DIS
declare external void @DoSomething()
......
......@@ -13,11 +13,11 @@
; Compile using integrated assembler.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
; RUN: -unsafe-ias | FileCheck %s --check-prefix=IASM
; RUN: | FileCheck %s --check-prefix=IASM
; Show bytes in assembled integrated code.
; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
; RUN: --args -Om1 -unsafe-ias | FileCheck %s --check-prefix=DIS
; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS
define internal void @test_vla_in_loop(i32 %n) {
; ASM-LABEL: test_vla_in_loop:
......
......@@ -73,7 +73,11 @@ entry:
; ASM-NEXT: mov r0, r1
; DIS-NEXT: 10: e1a00001
; IASM-NEXT: mov r0, r1
; IASM-NEXT: .byte 0x1
; IASM-NEXT: .byte 0x0
; IASM-NEXT: .byte 0xa0
; IASM-NEXT: .byte 0xe1
; ASM-NEXT: bx lr
; DIS-NEXT: 14: e12fff1e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment