From 85c622d6b6633c19d2729e82453c6c7f56ee7cd9 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Sat, 1 Jun 2013 09:55:14 +0000 Subject: X86: change MOV64ri64i32 into MOV32ri64 The MOV64ri64i32 instruction required hacky MCInst lowering because it was allocated as setting a GR64, but the eventual instruction ("movl") only set a GR32. This converts it into a so-called "MOV32ri64" which still accepts a (appropriate) 64-bit immediate but defines a GR32. This is then converted to the full GR64 by a SUBREG_TO_REG operation, thus keeping everyone happy. This fixes a typo in the opcode field of the original patch, which should make the legact JIT work again (& adds test for that problem). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183068 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/ExecutionEngine/mov64zext32.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/ExecutionEngine/mov64zext32.ll (limited to 'test/ExecutionEngine') diff --git a/test/ExecutionEngine/mov64zext32.ll b/test/ExecutionEngine/mov64zext32.ll new file mode 100644 index 0000000..00241c8 --- /dev/null +++ b/test/ExecutionEngine/mov64zext32.ll @@ -0,0 +1,17 @@ +; RUN: %lli %s > /dev/null + +define i64 @foo() { + ret i64 42 +} + +define i32 @main() { + %val = call i64 @foo() + %is42 = icmp eq i64 %val, 42 + br i1 %is42, label %good, label %bad + +good: + ret i32 0 + +bad: + ret i32 1 +} \ No newline at end of file -- cgit v1.1