+2013-05-07 Jayant Sonar <jayant.sonar@kpitcummins.com>
+ Kaushik Phatak <Kaushik.Phatak@kpitcummins.com>
+
+ * armemu.c (ARMul_Emulate32): Emulate instructions MOVW and MOVT.
+
2012-12-19 Joel Brobecker <brobecker@adacore.com>
* COPYING: Update to GPL version 3.
WRITESDEST (dest);
break;
- case 0x30: /* TST immed */
- UNDEF_Test;
+ case 0x30: /* MOVW immed */
+ dest = BITS (0, 11);
+ dest |= (BITS (16, 19) << 12);
+ WRITEDEST (dest);
break;
case 0x31: /* TSTP immed */
}
break;
- case 0x34: /* CMP immed */
- UNDEF_Test;
+ case 0x34: /* MOVT immed */
+ dest = BITS (0, 11);
+ dest |= (BITS (16, 19) << 12);
+ DEST |= (dest << 16);
break;
case 0x35: /* CMPP immed */
+2013-05-07 Jayant Sonar <jayant.sonar@kpitcummins.com>
+ Kaushik Phatak <Kaushik.Phatak@kpitcummins.com>
+
+ * movw-movt.ms: New file: Test movw & movt instructions.
+
2011-07-01 Nick Clifton <nickc@redhat.com>
PR sim/12737
--- /dev/null
+# output(): Hello, world.\n
+# mach(): all
+
+# This is a test for movw & movt instructions.
+# It emits hello world if movw & movt works appropriately.
+
+ .macro invalid
+# This is "undefined" but it's not properly decoded yet.
+ .word 0x07ffffff
+# This is stc which isn't recognized yet.
+ stc 0,cr0,[r0]
+ .endm
+
+ .global _start
+_start:
+# Run some simple insns to confirm the engine is at least working.
+ nop
+
+# Skip over output text.
+
+ bl skip_output
+
+hello_text:
+ .asciz "Hello, world.\n"
+
+ .p2align 2
+skip_output:
+ movw r4, #:lower16:hello_text
+ movt r4, #:upper16:hello_text
+
+output_next:
+# Output a character
+ mov r0,#3
+ mov r1,r4
+ swi #0x123456
+
+# Load next character, see if done.
+ add r4,r4,#1
+ sub r3,r3,r3
+ ldrb r5,[r4,r3]
+ teq r5,#0
+ bne output_next
+
+done:
+ mov r0,#0x18
+ ldr r1,exit_code
+ swi #0x123456
+
+# If that fails, try to die with an invalid insn.
+ invalid
+
+exit_code:
+ .word 0x20026