|
From: Vince W. <vi...@cs...> - 2010-01-02 05:19:36
|
Hello with the ARM work hitting the tree, I thought I'd see about getting some arm tests working for the exp-bbv tool. The patch below is a first attempt. The results files currently aren't correct; the only ARM machine I have access to is armv5 which doesn't seem to be supported currently. I hacked the configure script to allow arm5* and modified dispatch-arm-linux.S to not touch FPSCR but that doesn't seem to be enough; valgrind builds just fine but any programs run through it instantly give illegal instruction errrors. Vince Index: exp-bbv/tests/Makefile.am =================================================================== --- exp-bbv/tests/Makefile.am (revision 10988) +++ exp-bbv/tests/Makefile.am (working copy) @@ -16,8 +16,11 @@ if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX SUBDIRS += ppc32-linux endif +if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX +SUBDIRS += arm-linux +endif -DIST_SUBDIRS = x86 x86-linux amd64-linux ppc32-linux . +DIST_SUBDIRS = x86 x86-linux amd64-linux ppc32-linux arm-linux . dist_noinst_SCRIPTS = \ filter_bb \ Index: exp-bbv/tests/arm-linux/million.stderr.exp =================================================================== --- exp-bbv/tests/arm-linux/million.stderr.exp (revision 0) +++ exp-bbv/tests/arm-linux/million.stderr.exp (revision 0) @@ -0,0 +1,6 @@ +# Thread 1 +# Total intervals: 10 (Interval Size 100000) +# Total instructions: 1000000 +# Total reps: 0 +# Unique reps: 0 +# Total fldcw instructions: 0 Index: exp-bbv/tests/arm-linux/ll.vgtest =================================================================== --- exp-bbv/tests/arm-linux/ll.vgtest (revision 0) +++ exp-bbv/tests/arm-linux/ll.vgtest (revision 0) @@ -0,0 +1,5 @@ +prog: ll +vgopts: --interval-size=1000 --bb-out-file=ll.out.bb +post: cat ll.out.bb +cleanup: rm ll.out.bb + Index: exp-bbv/tests/arm-linux/million.post.exp =================================================================== --- exp-bbv/tests/arm-linux/million.post.exp (revision 0) +++ exp-bbv/tests/arm-linux/million.post.exp (revision 0) @@ -0,0 +1,18 @@ +T:1:5 :2:99996 +T:2:100000 +T:2:100000 +T:2:100000 +T:2:100000 +T:2:100000 +T:2:100000 +T:2:100000 +T:2:100000 + + +# Thread 1 +# Total intervals: 10 (Interval Size 100000) +# Total instructions: 1000000 +# Total reps: 0 +# Unique reps: 0 +# Total fldcw instructions: 0 + Index: exp-bbv/tests/arm-linux/ll.stdout.exp =================================================================== --- exp-bbv/tests/arm-linux/ll.stdout.exp (revision 0) +++ exp-bbv/tests/arm-linux/ll.stdout.exp (revision 0) @@ -0,0 +1,16 @@ +[0;1;37;47m#################################################################[0;30;47m#####[1;37m#########[1;37;40m +[0;1;37;47m################################################################[0;30;47m#######[1;37m########[1;37;40m +[0;1;37;47m###################[31m#[37m############################################[0;30;47m##[1;37mO[0;30;47m#[1;37mO[0;30;47m##[1;37m########[1;37;40m +[0;1;37;47m##[0;30;47m######[1;37m##########[31m##[0;30;47m#[1;37m###########################################[0;30;47m#[1;33m#####[0;30;47m#[1;37m########[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m#############[0;30;47m#[1;37m##########################################[0;30;47m##[1;37m##[33m###[37m##[0;30;47m##[1;37m######[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m#########[31m###[37m###[0;30;47m###[1;37m#[0;30;47m####[1;37m###[0;30;47m###[1;37m####[0;30;47m###[1;37m##[0;30;47m#####[1;37m#[0;30;47m######[1;37m#####[0;30;47m#[1;37m##########[0;30;47m##[1;37m#####[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m########[31m#[37m##[31m#[0;30;47m#[1;37m###[0;30;47m###[1;37m####[0;30;47m##[1;37m##[0;30;47m##[1;37m#####[0;30;47m##[1;37m####[0;30;47m##[1;37m###[0;30;47m##[1;37m#######[0;30;47m#[1;37m############[0;30;47m##[1;37m####[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m#######[31m#[37m###[31m#[0;30;47m#[1;37m###[0;30;47m##[1;37m#####[0;30;47m##[1;37m##[0;30;47m##[1;37m#####[0;30;47m##[1;37m######[0;30;47m###[1;37m#########[0;30;47m#[1;37m############[0;30;47m###[1;37m###[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m##########[31m##[0;30;47m#[1;37m###[0;30;47m##[1;37m#####[0;30;47m##[1;37m##[0;30;47m##[1;37m#####[0;30;47m##[1;37m######[0;30;47m###[1;37m########[33m##[0;30;47m#[1;37m###########[0;30;47m##[1;33m#[37m###[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m#######[0;30;47m#[1;37m#[31m##[0;30;47m#[1;37m####[0;30;47m##[1;37m#####[0;30;47m##[1;37m##[0;30;47m##[1;37m#####[0;30;47m##[1;37m#####[0;30;47m##[1;37m#[0;30;47m##[1;37m#####[33m######[0;30;47m#[1;37m#######[30m#[33m######[37m#[1;37;40m +[0;1;37;47m####[0;30;47m##[1;37m######[0;30;47m##[1;37m#[31m##[0;30;47m#[1;37m#[0;30;47m#[1;37m##[0;30;47m##[1;37m#####[0;30;47m##[1;37m##[0;30;47m###[1;37m###[0;30;47m###[1;37m####[0;30;47m##[1;37m###[0;30;47m##[1;37m####[33m#######[0;30;47m#[1;37m#####[0;30;47m#[1;33m#######[37m#[1;37;40m +[0;1;37;47m##[0;30;47m############[1;37m##[0;30;47m###[1;37m##[0;30;47m####[1;37m###[0;30;47m####[1;37m###[0;30;47m####[1;37m#[0;30;47m###[1;37m#[0;30;47m#####[1;37m#[0;30;47m######[1;37m###[33m#####[30m#[0;30;47m#####[1m#[33m#####[37m###[1;37;40m + +[9CLinux Version 2.6.29, Compiled #1 Wed May 13 15:51:54 UTC 2009 +[9COne 600.000000MHz PPC 745/755, 512M RAM, 49.79 Bogomips Total +[36Chenparma Index: exp-bbv/tests/arm-linux/ll.stderr.exp =================================================================== --- exp-bbv/tests/arm-linux/ll.stderr.exp (revision 0) +++ exp-bbv/tests/arm-linux/ll.stderr.exp (revision 0) @@ -0,0 +1,6 @@ +# Thread 1 +# Total intervals: 40 (Interval Size 1000) +# Total instructions: 40330 +# Total reps: 0 +# Unique reps: 0 +# Total fldcw instructions: 0 Index: exp-bbv/tests/arm-linux/million.S =================================================================== --- exp-bbv/tests/arm-linux/million.S (revision 0) +++ exp-bbv/tests/arm-linux/million.S (revision 0) @@ -0,0 +1,27 @@ + + # count for 1 million instructions + # total is 1 + 333332*3 + 2 + + +# Sycscalls +.equ SYSCALL_BASE, 0x900000 +.equ SYSCALL_EXIT, 1 + + .globl _start +_start: + + ldr r2,count @ set count + +big_loop: + add r2,r2,#-1 + cmp r2,#0 + bne big_loop @ repeat till zero + + @================================ + @ Exit + @================================ +exit: + mov r0,#0 @ result is zero + swi SYSCALL_BASE+SYSCALL_EXIT @ and exit + +count: .word 333332 Index: exp-bbv/tests/arm-linux/ll.post.exp =================================================================== --- exp-bbv/tests/arm-linux/ll.post.exp (revision 0) +++ exp-bbv/tests/arm-linux/ll.post.exp (revision 0) @@ -0,0 +1,49 @@ +T:1:16 :8:10 :6:32 :2:56 :9:48 :10:666 :4:90 :5:36 :7:2 :3:45 +T:8:5 :6:20 :2:34 :9:80 :10:775 :4:42 :5:22 :7:1 :3:21 +T:8:5 :6:16 :2:27 :9:64 :10:824 :4:30 :5:18 :7:1 :3:15 +T:8:5 :6:10 :2:18 :9:80 :10:865 :4:6 :5:12 :7:1 :3:3 +T:8:5 :6:10 :2:18 :9:96 :10:858 :5:12 :7:1 +T:8:5 :6:10 :2:18 :9:80 :10:865 :4:6 :5:12 :7:1 :3:3 +T:6:6 :2:9 :9:36 :10:943 :5:6 +T:8:5 :6:8 :2:15 :9:92 :10:869 :5:10 :7:1 +T:6:14 :2:21 :9:112 :10:839 :5:14 +T:8:5 :6:6 :2:12 :9:64 :10:902 :5:10 :7:1 +T:8:5 :6:8 :2:15 :9:80 :10:883 :5:8 :7:1 +T:6:8 :2:12 :9:64 :10:908 :5:8 +T:6:6 :2:9 :9:48 :10:931 :5:6 +T:8:5 :6:4 :2:9 :9:48 :10:927 :5:6 :7:1 +T:6:6 :2:9 :9:48 :10:931 :5:6 +T:8:5 :6:6 :2:12 :9:64 :10:904 :5:8 :7:1 +T:6:2 :2:3 :9:16 :10:977 :5:2 +T:8:5 :6:12 :2:21 :9:96 :10:842 :4:6 :5:14 :7:1 :3:3 +T:6:6 :2:9 :9:48 :10:931 :5:6 +T:6:6 :2:9 :9:48 :10:931 :5:6 +T:8:5 :6:14 :2:24 :9:112 :10:819 :4:6 :5:16 :7:1 :3:3 +T:8:5 :6:6 :2:12 :9:64 :10:904 :5:8 :7:1 +T:6:6 :2:9 :9:48 :10:931 :5:6 +T:8:5 :6:8 :2:15 :9:80 :10:881 :5:10 :7:1 +T:8:5 :6:10 :2:18 :9:96 :10:858 :5:12 :7:1 +T:6:10 :2:15 :9:80 :10:885 :5:10 +T:8:5 :6:10 :2:15 :9:64 :10:470 :4:6 :5:12 :7:1 :3:3 :11:2 :12:7 :13:405 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:13:1000 +T:16:2 :19:2 :20:2 :21:2 :22:2 :23:1 :17:268 :18:10 :24:4 :25:6 :26:3 :30:3 :31:2 :12:28 :13:636 :14:8 :15:4 :27:12 :28:2 :29:3 +T:33:3 :34:4 :46:2 :47:4 :48:2 :49:4 :53:2 :54:4 :35:8 :37:246 :36:168 :38:8 :40:27 :39:22 :41:8 :44:51 :42:38 :43:34 :45:6 :17:116 :18:10 :32:10 :13:183 :14:4 :15:2 :27:12 :50:16 :28:2 :51:2 :52:2 +T:55:2 :56:1 :35:4 :37:381 :36:256 :38:4 :40:12 :39:10 :41:4 :44:15 :42:12 :43:10 :45:3 :17:64 :18:2 :24:4 :25:6 :26:3 :30:3 :31:2 :12:28 :13:148 :14:6 :15:3 :27:12 :28:2 :29:3 + + +# Thread 1 +# Total intervals: 40 (Interval Size 1000) +# Total instructions: 40330 +# Total reps: 0 +# Unique reps: 0 +# Total fldcw instructions: 0 + Index: exp-bbv/tests/arm-linux/filter_stderr =================================================================== --- exp-bbv/tests/arm-linux/filter_stderr (revision 0) +++ exp-bbv/tests/arm-linux/filter_stderr (revision 0) @@ -0,0 +1,5 @@ +#! /bin/sh + +../filter_stderr + + Property changes on: exp-bbv/tests/arm-linux/filter_stderr ___________________________________________________________________ Added: svn:executable + * Index: exp-bbv/tests/arm-linux/ll.S =================================================================== --- exp-bbv/tests/arm-linux/ll.S (revision 0) +++ exp-bbv/tests/arm-linux/ll.S (revision 0) @@ -0,0 +1,519 @@ +# +# linux_logo in ARM assembly language +# based on the code from ll_asm-0.41 +# +# By Vince Weaver <vince _at_ deater.net> +# +# Modified to remove non-deterministic system calls +# And to avoid reading from /proc + +.include "../logo.include" + +# offsets into the results returned by the uname syscall +.equ U_SYSNAME,0 +.equ U_NODENAME,65 +.equ U_RELEASE,65*2 +.equ U_VERSION,(65*3) +.equ U_MACHINE,(65*4) +.equ U_DOMAINNAME,65*5 + +# offset into the results returned by the sysinfo syscall +.equ S_TOTALRAM,16 + +# Sycscalls +.equ SYSCALL_BASE, 0x900000 +.equ SYSCALL_EXIT, 1 +#.equ SYSCALL_READ, 3 +.equ SYSCALL_WRITE, 4 +#.equ SYSCALL_OPEN, 5 +#.equ SYSCALL_CLOSE, 6 +#.equ SYSCALL_SYSINFO, 116 +#.equ SYSCALL_UNAME, 122 + +# +.equ STDIN,0 +.equ STDOUT,1 +.equ STDERR,2 + + .globl _start +_start: + ldr r11,data_addr + ldr r12,bss_addr + + #========================= + # PRINT LOGO + #========================= + +# LZSS decompression algorithm implementation +# by Stephan Walter 2002, based on LZSS.C by Haruhiko Okumura 1989 +# optimized some more by Vince Weaver + + ldr r1,out_addr @ buffer we are printing to + + mov r2,#(N-F) @ R + + add r3,r11,#(logo-data_begin) + @ r3 points to logo data + ldr r8,logo_end_addr + @ r8 points to logo end + ldr r9,text_addr @ r9 points to text buf + +decompression_loop: + ldrb r4,[r3],#+1 @ load a byte, increment pointer + + mov r5,#0xff @ load top as a hackish 8-bit counter + orr r5,r4,r5,LSL #8 @ shift 0xff left by 8 and or in the byte we loaded + +test_flags: + cmp r3,r8 @ have we reached the end? + bge done_logo @ if so, exit + + lsrs r5,#1 @ shift bottom bit into carry flag + bcs discrete_char @ if set, we jump to discrete char + +offset_length: + ldrb r0,[r3],#+1 @ load a byte, increment pointer + ldrb r4,[r3],#+1 @ load a byte, increment pointer + @ we can't load halfword as no unaligned loads on arm + + orr r4,r0,r4,LSL #8 @ merge back into 16 bits + @ this has match_length and match_position + + mov r7,r4 @ copy r4 to r7 + @ no need to mask r7, as we do it + @ by default in output_loop + + mov r0,#(THRESHOLD+1) + add r6,r0,r4,LSR #(P_BITS) + @ r6 = (r4 >> P_BITS) + THRESHOLD + 1 + @ (=match_length) + +output_loop: + ldr r0,pos_mask @ urgh, can't handle simple constants + and r7,r7,r0 @ mask it + ldrb r4,[r9,r7] @ load byte from text_buf[] + add r7,r7,#1 @ advance pointer in text_buf + +store_byte: + strb r4,[r1],#+1 @ store a byte, increment pointer + strb r4,[r9,r2] @ store a byte to text_buf[r] + add r2,r2,#1 @ r++ + mov r0,#(N) + sub r0,r0,#1 @ grrr no way to get this easier + and r2,r2,r0 @ mask r + + subs r6,r6,#1 @ decement count + bne output_loop @ repeat until k>j + + tst r5,#0xff00 @ are the top bits 0? + bne test_flags @ if not, re-load flags + + b decompression_loop + +discrete_char: + ldrb r4,[r3],#+1 @ load a byte, increment pointer + mov r6,#1 @ we set r6 to one so byte + @ will be output once + + b store_byte @ and store it + + +# end of LZSS code + +done_logo: + ldr r1,out_addr @ buffer we are printing to + + bl write_stdout @ print the logo + + #========================== + # PRINT VERSION + #========================== +first_line: + + mov r0,#0 +# add r0,r12,#(uname_info-data_begin) @ uname struct +# swi SYSCALL_BASE+SYSCALL_UNAME @ do syscall + + add r1,r11,#(uname_info-data_begin) + @ os-name from uname "Linux" + + ldr r10,out_addr @ point r10 to out_buffer + + bl strcat @ call strcat + + + add r1,r11,#(ver_string-data_begin) @ source is " Version " + bl strcat @ call strcat + + add r1,r11,#((uname_info-data_begin)+U_RELEASE) + @ version from uname, ie "2.6.20" + bl strcat @ call strcat + + add r1,r11,#(compiled_string-data_begin) + @ source is ", Compiled " + bl strcat @ call strcat + + add r1,r11,#((uname_info-data_begin)+U_VERSION) + @ compiled date + bl strcat @ call strcat + + mov r3,#0xa + strb r3,[r10],#+1 @ store a linefeed, increment pointer + strb r0,[r10],#+1 @ NUL terminate, increment pointer + + bl center_and_print @ center and print + + @=============================== + @ Middle-Line + @=============================== +middle_line: + @========= + @ Load /proc/cpuinfo into buffer + @========= + + ldr r10,out_addr @ point r10 to out_buffer + +# add r0,r11,#(cpuinfo-data_begin) + @ '/proc/cpuinfo' +# mov r1,#0 @ 0 = O_RDONLY <bits/fcntl.h> +# swi SYSCALL_BASE+SYSCALL_OPEN + @ syscall. return in r0? +# mov r5,r0 @ save our fd +# ldr r1,disk_addr +# mov r2,#4096 + @ 4096 is maximum size of proc file ;) +# swi SYSCALL_BASE+SYSCALL_READ + +# mov r0,r5 +# swi SYSCALL_BASE+SYSCALL_CLOSE + @ close (to be correct) + + + @============= + @ Number of CPUs + @============= +number_of_cpus: + + add r1,r11,#(one-data_begin) + # cheat. Who has an SMP arm? + bl strcat + + @========= + @ MHz + @========= +print_mhz: + + @ the arm system I have does not report MHz + + @========= + @ Chip Name + @========= +chip_name: + mov r0,#'s' + mov r1,#'o' + mov r2,#'r' + mov r3,#' ' + bl find_string + @ find 'sor\t: ' and grab up to ' ' + + add r1,r11,#(processor-data_begin) + @ print " Processor, " + bl strcat + + @======== + @ RAM + @======== + +# add r0,r12,#(sysinfo_buff-data_begin) +# swi SYSCALL_BASE+SYSCALL_SYSINFO +# @ sysinfo() syscall + + ldr r3,[r11,#((sysinfo_buff-data_begin)+S_TOTALRAM)] + @ size in bytes of RAM + movs r3,r3,lsr #20 @ divide by 1024*1024 to get M + adc r3,r3,#0 @ round + + mov r0,#1 + bl num_to_ascii + + add r1,r11,#(ram_comma-data_begin) + @ print 'M RAM, ' + bl strcat @ call strcat + + + @======== + @ Bogomips + @======== + + mov r0,#'I' + mov r1,#'P' + mov r2,#'S' + mov r3,#'\n' + bl find_string + + add r1,r11,#(bogo_total-data_begin) + bl strcat @ print bogomips total + + bl center_and_print @ center and print + + #================================= + # Print Host Name + #================================= +last_line: + ldr r10,out_addr @ point r10 to out_buffer + + add r1,r11,#((uname_info-data_begin)+U_NODENAME) + @ host name from uname() + bl strcat @ call strcat + + bl center_and_print @ center and print + + add r1,r11,#(default_colors-data_begin) + @ restore colors, print a few linefeeds + bl write_stdout + + + @================================ + @ Exit + @================================ +exit: + mov r0,#0 @ result is zero + swi SYSCALL_BASE+SYSCALL_EXIT @ and exit + + + @================================= + @ FIND_STRING + @================================= + @ r0,r1,r2 = string to find + @ r3 = char to end at + @ r5 trashed +find_string: + ldr r7,disk_addr @ look in cpuinfo buffer +find_loop: + ldrb r5,[r7],#+1 @ load a byte, increment pointer + cmp r5,r0 @ compare against first byte + ldrb r5,[r7] @ load next byte + cmpeq r5,r1 @ if first byte matched, comp this one + ldrb r5,[r7,#+1] @ load next byte + cmpeq r5,r2 @ if first two matched, comp this one + beq find_colon @ if all 3 matched, we are found + + cmp r5,#0 @ are we at EOF? + beq done @ if so, done + + b find_loop + +find_colon: + ldrb r5,[r7],#+1 @ load a byte, increment pointer + cmp r5,#':' + bne find_colon @ repeat till we find colon + + add r7,r7,#1 @ skip the space + +store_loop: + ldrb r5,[r7],#+1 @ load a byte, increment pointer + strb r5,[r10],#+1 @ store a byte, increment pointer + cmp r5,r3 + bne store_loop + +almost_done: + mov r0,#0 + strb r0,[r10],#-1 @ replace last value with NUL + +done: + blx r14 @ return + + #================================ + # strcat + #================================ + # value to cat in r1 + # output buffer in r10 + # r3 trashed +strcat: + ldrb r3,[r1],#+1 @ load a byte, increment pointer + strb r3,[r10],#+1 @ store a byte, increment pointer + cmp r3,#0 @ is it zero? + bne strcat @ if not loop + sub r10,r10,#1 @ point to one less than null + bx r14 @ return + + + #============================== + # center_and_print + #============================== + # string to center in at output_buffer + +center_and_print: + + stmfd SP!,{LR} @ store return address on stack + + add r1,r11,#(escape-data_begin) + @ we want to output ^[[ + bl write_stdout + +str_loop2: + ldr r2,out_addr @ point r2 to out_buffer + sub r2,r10,r2 @ get length by subtracting + + rsb r2,r2,#81 @ reverse subtract! r2=81-r2 + @ we use 81 to not count ending \n + + bne done_center @ if result negative, don't center + + lsrs r3,r2,#1 @ divide by 2 + adc r3,r3,#0 @ round? + + mov r0,#0 @ print to stdout + bl num_to_ascii @ print number of spaces + + add r1,r11,#(C-data_begin) + @ we want to output C + bl write_stdout + +done_center: + ldr r1,out_addr @ point r1 to out_buffer + ldmfd SP!,{LR} @ restore return address from stack + + #================================ + # WRITE_STDOUT + #================================ + # r1 has string + # r0,r2,r3 trashed +write_stdout: + mov r2,#0 @ clear count + +str_loop1: + add r2,r2,#1 + ldrb r3,[r1,r2] + cmp r3,#0 + bne str_loop1 @ repeat till zero + +write_stdout_we_know_size: + mov r0,#STDOUT @ print to stdout + swi SYSCALL_BASE+SYSCALL_WRITE @ run the syscall + bx r14 @ return + + + @############################# + @ num_to_ascii + @############################# + @ r3 = value to print + @ r0 = 0=stdout, 1=strcat + +num_to_ascii: + stmfd SP!,{r10,LR} @ store return address on stack + add r10,r12,#((ascii_buffer-bss_begin)) + add r10,r10,#10 + @ point to end of our buffer + + mov r4,#10 @ we'll be dividing by 10 +div_by_10: + bl divide @ Q=r7,$0, R=r8,$1 + add r8,r8,#0x30 @ convert to ascii + strb r8,[r10],#-1 @ store a byte, decrement pointer + adds r3,r7,#0 @ move Q in for next divide, update flags + bne div_by_10 @ if Q not zero, loop + +write_out: + add r1,r10,#1 @ adjust pointer + ldmfd SP!,{r10,LR} @ restore return address from stack + + cmp r0,#0 + bne strcat @ if 1, strcat + + b write_stdout @ else, fallthrough to stdout + + + @=================================================== + @ Divide - because ARM has no hardware int divide + @ yes this is an awful algorithm, but simple + @ and uses few registers + @================================================== + @ r3=numerator r4=denominator + @ r7=quotient r8=remainder + @ r5=trashed +divide: + + mov r7,#0 @ zero out quotient +divide_loop: + mul r5,r7,r4 @ multiply Q by denominator + add r7,r7,#1 @ increment quotient + cmp r5,r3 @ is it greater than numerator? + ble divide_loop @ if not, loop + sub r7,r7,#2 @ otherwise went too far, decrement + @ and done + + mul r5,r7,r4 @ calculate remainder + sub r8,r3,r5 @ R=N-(Q*D) + blx r14 @ return + + +bss_addr: .word bss_begin +data_addr: .word data_begin +out_addr: .word out_buffer +disk_addr: .word disk_buffer +logo_end_addr: .word logo_end +pos_mask: .word ((POSITION_MASK<<8)+0xff) +text_addr: .word text_buf + +#=========================================================================== +# section .data +#=========================================================================== +.data +data_begin: +ver_string: .ascii " Version \0" +compiled_string: .ascii ", Compiled \0" +processor: .ascii " Processor, \0" +ram_comma: .ascii "M RAM, \0" +bogo_total: .ascii " Bogomips Total\n\0" + +default_colors: .ascii "\033[0m\n\n\0" +escape: .ascii "\033[\0" +C: .ascii "C\0" + +one: .ascii "One \0" + +uname_info: +.ascii "Linux\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "lindt\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "2.6.32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "#1 Wed May 13 15:51:54 UTC 2009\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +.ascii "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + + +disk_buffer: +.ascii "Processor : Feroceon 88FR131 rev 1 (v5l)\n" +.ascii "BogoMIPS : 1192.75\n" +.ascii "Features : swp half thumb fastmult edsp \n" +.ascii "CPU implementer : 0x56\n" +.ascii "CPU architecture: 5TE\n" +.ascii "CPU variant : 0x2\n" +.ascii "CPU part : 0x131\n" +.ascii "CPU revision : 1\n" +.ascii "\n" +.ascii "Hardware : Marvell SheevaPlug Reference Board\n" +.ascii "Revision : 0000\n" +.ascii "Serial : 0000000000000000\n\0" + + +sysinfo_buff: +.long 0,0,0,0,512*1024*1024,0,0,0 + +.include "../logo.lzss_new" + + +#============================================================================ +# section .bss +#============================================================================ +.bss +bss_begin: +.lcomm ascii_buffer,10 +.lcomm text_buf, (N+F-1) +.lcomm out_buffer,16384 Index: exp-bbv/tests/arm-linux/Makefile.am =================================================================== --- exp-bbv/tests/arm-linux/Makefile.am (revision 0) +++ exp-bbv/tests/arm-linux/Makefile.am (revision 0) @@ -0,0 +1,22 @@ +include $(top_srcdir)/Makefile.tool-tests.am + +dist_noinst_SCRIPTS = filter_stderr + +check_PROGRAMS = \ + million ll + +EXTRA_DIST = \ + ll.stderr.exp \ + ll.stdout.exp \ + ll.post.exp \ + ll.vgtest \ + million.stderr.exp \ + million.post.exp \ + million.vgtest + +AM_CCASFLAGS += -ffreestanding + +LDFLAGS += -nostartfiles -nodefaultlibs + +ll_SOURCES = ll.S +million_SOURCES = million.S Index: exp-bbv/tests/arm-linux/million.vgtest =================================================================== --- exp-bbv/tests/arm-linux/million.vgtest (revision 0) +++ exp-bbv/tests/arm-linux/million.vgtest (revision 0) @@ -0,0 +1,5 @@ +prog: million +vgopts: --interval-size=100000 --bb-out-file=million.out.bb +post: cat million.out.bb +cleanup: rm million.out.bb + Index: configure.in =================================================================== --- configure.in (revision 10988) +++ configure.in (working copy) @@ -1933,6 +1933,7 @@ exp-bbv/tests/x86-linux/Makefile exp-bbv/tests/amd64-linux/Makefile exp-bbv/tests/ppc32-linux/Makefile + exp-bbv/tests/arm-linux/Makefile ]) AC_OUTPUT |
|
From: Julian S. <js...@ac...> - 2010-01-03 22:07:49
|
Vince,
> with the ARM work hitting the tree, I thought I'd see about getting some
> arm tests working for the exp-bbv tool.
Good, however ..
> The results files currently aren't correct; the only ARM machine I have
> access to is armv5 which doesn't seem to be supported currently. I hacked
> the configure script to allow arm5* and modified dispatch-arm-linux.S to
> not touch FPSCR but that doesn't seem to be enough; valgrind builds just
> fine but any programs run through it instantly give illegal instruction
> errrors.
v7 is really the minimum supported target. The JIT produces mostly
v5 instructions but some v6 (load 16-bit immediates into a lower/upper
register half), and a few v7 (ldrex{,b,w,d} and strex{,b,w,d}) to do
with atomic memory accesses, and it also assumes the presence of VFP.
So it's not surprising it SIGILLd on a v5 cpu.
J
|
|
From: Vince W. <vi...@cs...> - 2010-01-03 22:57:01
|
On Sun, 3 Jan 2010, Julian Seward wrote:
>
> v7 is really the minimum supported target. The JIT produces mostly
> v5 instructions but some v6 (load 16-bit immediates into a lower/upper
> register half), and a few v7 (ldrex{,b,w,d} and strex{,b,w,d}) to do
> with atomic memory accesses, and it also assumes the presence of VFP.
> So it's not surprising it SIGILLd on a v5 cpu.
My test cases don't use atomic memory accesses, so changing the #if 0 in
VEX/priv/host_arm_defs.c to #if 1 ( to not generate the thumb2 16-bit
immediate instructions ) was enough to get things running on my test
system.
I also had to fix my test cases to not use the blx opcode, and to use the
new EABI syscall style. The tests seems to run correctly now.
Would it be OK to commit the exp-bbv arm test cases? The only change made
outside of the exp-bbv tree is to add the
exp-bbv/tests/arm-linux/Makefile
line to the master configure.in file. I can post the updated patch if
others want to review first.
Vince
|
|
From: Julian S. <js...@ac...> - 2010-01-06 16:02:56
|
> Would it be OK to commit the exp-bbv arm test cases? Yes, please do. J |