GitHub31 | [extras-m1] yizhangsh pushed 2 new commits to master: https://github.com/milkymist/extras-m1/compare/59e8a82...6fcaa21 | 09:17 |
---|---|---|
GitHub31 | [extras-m1/master] removed distrabutors list. added Notes block - Yi Zhang | 09:17 |
GitHub31 | [extras-m1/master] adjust manufacturer position - Yi Zhang | 09:17 |
Alarm | Compiling the program using the VGA output (Elektor) me miseries: | 10:07 |
Alarm | http://pastebin.com/xAuxaeet | 10:07 |
Alarm | ;) | 10:07 |
GitHub176 | [extras-m1] shiyele pushed 1 new commit to master: https://github.com/milkymist/extras-m1/commit/e16377e0c57ea3ef5795b60859187d45bae7fa96 | 12:18 |
GitHub176 | [extras-m1/master] added engraved logo file - Wolfgang Spraul | 12:18 |
GitHub13 | [extras-m1] shiyele pushed 1 new commit to master: https://github.com/milkymist/extras-m1/commit/d90414bb91a64dac9bf572e842e8cc58acedbcfe | 12:56 |
GitHub13 | [extras-m1/master] updated assembly manual from roh - Wolfgang Spraul | 12:56 |
Alarm | lekernel: made progress but I still have an error in the compilation of the program Elektor | 13:57 |
Alarm | http://pastebin.com/jtPdWgjD | 13:57 |
kristianpaul | lekernel: in verilog can i declare a module twice in differnt part of the code?, but not the same signal of course | 14:29 |
kristianpaul | my point is that i want to debug some signal that are not directly wired to the top module | 14:29 |
kristianpaul | so i wanted to avoid that, if posible.. | 14:29 |
kristianpaul | sorry if in mind you with my silly question, but this si due your great expertice in the field :-) | 14:30 |
kristianpaul | and yes, i'm aware of bitscope, i wanted to avoid, learn to use and the posible mess later implementing it.. | 14:31 |
Alarm | I am reassured I am not alone to ask silly questions;) | 14:34 |
kristianpaul | sure go ahed Alarm ! | 14:39 |
kristianpaul | lekernel is a bit rude (in the good sense) | 14:40 |
kristianpaul | but is okay, he is busy working hard on improvement the Milkymist SoC | 14:40 |
kristianpaul | so that is important :) | 14:40 |
Action: kristianpaul read about package signal | 14:41 | |
GitHub99 | [extras-m1] yizhangsh pushed 2 new commits to master: https://github.com/milkymist/extras-m1/compare/d90414b...f54abb6 | 15:11 |
GitHub99 | [extras-m1/master] removed some unnecessary punctuations - Yi Zhang | 15:11 |
GitHub99 | [extras-m1/master] added some punctuations - Yi Zhang | 15:11 |
GitHub154 | [extras-m1] yizhangsh pushed 1 new commit to master: https://github.com/milkymist/extras-m1/commit/a6581d04d7d14e217f66ee554fdbb2f7642b3c96 | 15:15 |
GitHub154 | [extras-m1/master] changed Save as PDF -> Viewer setting to single page - Yi Zhang | 15:15 |
mwalle | argh... | 16:19 |
mwalle | mmap2 syscall is broken | 16:19 |
mwalle | for some reason my gcc optimizes the syscall number away.. | 16:21 |
mwalle | larsc: is openwrt with the latest kernel working for you? | 16:25 |
larsc | yes | 16:34 |
mwalle | larsc: could you please post an objdump of libc/sysdeps/linux/common/mmap.o | 16:36 |
mwalle | from uclibc | 16:36 |
larsc | http://pastebin.com/8iYBEvhH | 16:37 |
mwalle | mh gcc --version? | 16:39 |
larsc | hm, for some reason that is sys_mmap and not sys_mmap2... | 16:40 |
mwalle | ahh :) | 16:41 |
mwalle | ok i guess after you are using mmap2 theres no mvi r8, <syscall no> | 16:42 |
larsc | yes, gone | 16:46 |
larsc | the shift seems to confuse gcc | 17:06 |
larsc | uninlining __syscall_mmap2 would solve the issue teporary | 17:10 |
kristianpaul | nothing more permanent than a temporary solution? :) | 17:16 |
larsc | a proper solution is to fix gcc | 17:17 |
larsc | moving LOAD_ARGS at the top of the function also seems to fix it | 17:23 |
mwalle | the dead code elimination pass removes the assignment | 17:46 |
larsc | i think doing the same as what arm does should do the trick | 17:48 |
larsc | first evaluate all parameters, then load them into the right registers | 17:49 |
mwalle | larsc: mh? where? | 17:51 |
larsc | something like this: http://pastebin.com/5idtavLE | 17:53 |
larsc | seems to work | 17:55 |
mwalle | with LOAD_ARGS behind _scno? | 17:55 |
larsc | before | 17:56 |
mwalle | "larsc | moving LOAD_ARGS at the top of the function also seems to fix it" << wasnt that already a workaround? | 17:56 |
larsc | yes, that works for mmap | 17:57 |
mwalle | what happens if you put your version of LOAD_ARGS behind _scno, like it was before? | 17:58 |
larsc | yes | 17:58 |
mwalle | yes, it is working? | 17:58 |
larsc | it's like before | 17:58 |
larsc | the assigment of r8 is dropped | 17:59 |
mwalle | so, then whats does http://pastebin.com/5idtavLE fix? :) | 18:00 |
larsc | if for example offset was not the last parameter to the systemcall we would loose the assigments of the registers which come after it as well | 18:01 |
mwalle | but thats only a workaround isn't it? | 18:03 |
larsc | maybe | 18:03 |
larsc | and it works | 18:03 |
mwalle | i dont see what should be wrong with the original code | 18:03 |
larsc | the problem here apparently is that if we do a function call after assigning the register the contents of that register is lost | 18:04 |
mwalle | where are we doing a function call? | 18:05 |
larsc | shift is a function call | 18:05 |
mwalle | are we still talking about the mmap syscall function? :) | 18:06 |
larsc | yes | 18:06 |
larsc | offset >> 12 evaluates to __shri(offset, 12) or whatever that function is called | 18:06 |
larsc | because we compile without barrel shifters enabled | 18:07 |
mwalle | but thats outside the __syscall_mmap2 function | 18:08 |
larsc | one would think so | 18:09 |
mwalle | so gcc forgets about the input variables after its inlining the functions?! | 18:12 |
larsc | it's probably some strange optimisation side effect | 18:15 |
mwalle | both -fno-dce or -fkeep-inline-functions are working (with the original code), so i would consider this another lm32 gcc bug | 18:15 |
larsc | it's probably not even lm32 specific | 18:16 |
mwalle | i bet it is :) | 18:18 |
mwalle | arm keeps it | 18:30 |
larsc | x86 too | 18:31 |
larsc | stuff get's properly reordered, so that the register is loaded after the function call | 18:34 |
mwalle | larsc: ok so the bug is that the soft shift is not called before the actual function | 20:12 |
mwalle | and of course the r8 assignment is optimized away, because its a caller saved register | 20:13 |
mwalle | i bet if that function call would be a 'normal' one (that is not a replacement for an opcode) it works as expected | 20:14 |
larsc | i think the bug is that gcc somehow forgets that _sco is in the asm instructions operand list | 20:15 |
mwalle | no if you look at the assemebler output | 20:15 |
mwalle | addi r8, r0, 222 | 20:15 |
mwalle | or r1, r6, r0 | 20:15 |
mwalle | addi r2, r0, 12 | 20:15 |
mwalle | calli __ashrsi3 | 20:15 |
mwalle | r8 may not be valid anymore after calli | 20:16 |
larsc | i know | 20:16 |
larsc | but gcc should restore it | 20:16 |
larsc | put it on the stack or whatever during the function call | 20:16 |
mwalle | addi r2, r0, 12 | 20:17 |
mwalle | calli __ashrsi3 | 20:17 |
mwalle | addi r8, r0, 222 | 20:17 |
mwalle | or r6, r1, r0 | 20:17 |
mwalle | or r5, r15, r0 | 20:17 |
mwalle | if you use return __syscall_mmap2(addr, len, prot, flags, fd, __ashrsi3(offset, 12)); | 20:17 |
larsc | hehe | 20:17 |
mwalle | so it must somewhere in the arch code that translate >> to sri or that function call | 20:18 |
larsc | so it probably assumes during the optimization phase that >> is a instruction | 20:18 |
mwalle | lets have a look at the wonderful gcc code :) | 20:19 |
mwalle | who understands that machine description language? :) | 20:20 |
mwalle | antgreen: ? :) | 20:20 |
larsc | i wonder if the same thing would happen if _sco would be used as a parameter for a normal function call | 20:21 |
mwalle | mh, my microblaze toolchain fails too.. | 20:39 |
larsc | with the same problem? | 20:48 |
mwalle | yes | 20:52 |
mwalle | so either this is a general problem with libgcc calls or both implementations are crap :) | 20:53 |
larsc | hm, i wonder what keywords to search for in the gcc bugtracker | 20:55 |
mwalle | dunno, i dont even know how that mechanism works.. when is a call to libgcc emitted.. | 21:01 |
larsc | i would assume it is the default | 21:03 |
mwalle | there are three methods to replace a shift, call to libgcc helper, barrelshifter or multiple shift by one | 21:04 |
larsc | hm, the documenation doesn't look to bad: gcc/doc/gccint.info | 21:08 |
Action: mwalle wonders if we are violating some internal gcc assumptions | 21:09 | |
mumptai | moin | 21:23 |
mwalle | larsc: ok avr has the same problem | 21:50 |
mwalle | i'm not sure if we are violating some constraints .. | 21:50 |
mwalle | n the above example, beware that a register that is call-clobbered by the target ABI will be overwritten by any function call in the assignment, including library calls for arithmetic operators. Also a register may be clobbered when generating some operations, like variable shift, memory copy or memory move on x86. Assuming it is a call-clobbered register, this may happen to r0 above by the assignment | 22:04 |
mwalle | to p2. If you have to use such a register, use temporary variables for expressions between the register assignment and use | 22:04 |
larsc | so the fix is the right thing to do | 22:07 |
mwalle | larsc: yes, but i think we have to evaluate all arguments and then assign them to the register variables | 22:09 |
mwalle | ah arm does that :) | 22:10 |
mwalle | oh and your proposed fix too, i missed the fact, that LOAD_ARGS is in the middle | 22:11 |
mwalle | larsc: so do you commit a patch? | 22:11 |
GitHub171 | [uclibc-lm32] larsclausen pushed 1 new commit to master: https://github.com/milkymist/uclibc-lm32/commit/df1075d1adc5dbc53e7746b0d80ade0b78b4deeb | 22:21 |
GitHub171 | [uclibc-lm32/master] lm32: Evaluate syscall all arguments before loading them into registers - Lars-Peter Clausen | 22:21 |
larsc | btw. should we add memory and cc to the syscall clobber list? | 22:24 |
mwalle | cc? | 22:25 |
mwalle | condition codes? | 22:26 |
mwalle | lm32 doesnt have condition flags, but memory should be ok | 22:27 |
GitHub125 | [uclibc-lm32] mwalle pushed 1 new commit to master: https://github.com/milkymist/uclibc-lm32/commit/defb191aab7711218035a506ec5cd8bb87c05c55 | 22:32 |
GitHub125 | [uclibc-lm32/master] lm32: update defconfig - Michael Walle | 22:32 |
mwalle | lol, next problem.. (sometimes?!) there are writes to the lowest page, after init is started | 22:43 |
mwalle | gn8 :) | 22:58 |
--- Mon Aug 1 2011 | 00:00 |
Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!