| View previous topic :: View next topic |
| Author |
Message |
R0
Joined: 02 Oct 2004 Posts: 7
|
Posted: Thu Aug 04, 2005 8:55 am Post subject: Unaligned memory access |
|
|
| How can I tell compiler to use "lwr/lwl" and "swr/swl" pairs instead of single "lw" and "sw" operations? I'd like to force compiler to generate those instructions for specified pointers. Is it possible ? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Aug 10, 2005 8:12 am Post subject: |
|
|
| Those are patented instructions and shouldn't be used. Use of those instructions could open you to patent license issues with MIPS (the company). They tend to be pretty pissy about the patent as well. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Aug 10, 2005 8:36 am Post subject: |
|
|
| I don't understand how an opcode can be patented and unavailable for use. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Wed Aug 10, 2005 3:15 pm Post subject: |
|
|
GCC will automatically have the assembler generate lwl, etc. for any unaligned accesses within a struct or union.
J.F.'s confused, the patent is for competing processors, not for MIPS CPUs that already support lwl and friends. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Aug 11, 2005 4:09 am Post subject: |
|
|
| The patent covers the implementation of the instruction. As such, no third party can make similar instructions. That much is established in several court cases. Another court case established that an emulator violated the patent by having software versions of those instructions, even though the emulator didn't implement the instructions the same way as in the patent. Given the scope the courts have allowed the MIPS patent and MIPS aggressive litigation on it, I'm not about to say that simply USING the instructions doesn't also require a license. Remember that patents don't just cover the MAKING of an invention but the USAGE of the invention as well. Unlicensed use of a patented invention is a violation. In this case, the invention is the patented instructions. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Thu Aug 11, 2005 4:46 am Post subject: |
|
|
Regardless of what you are blabbering about it's perfectly legal to use lwl/swl and lwr/swr on the PS1, PS2, PSP, and any other MIPS-based CPU that supports them. A company that licenses MIPS technology wouldn't implement those instructions if developers couldn't use them. That's silly.
With all that patent nonsense you didn't even bother to answer the guy's question. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Aug 18, 2005 5:39 am Post subject: |
|
|
Given the flood of patent suits in the US, it's a perfectly valid line of reasoning that could only be answered for sure by a patent attourney. But MrBrown is right - it can probably be ignored by most folks.
As to the question - it's silly on the face of it. Look in ANY MIPS manual and you'll find the answer as well as example code. |
|
| Back to top |
|
 |
Rk
Joined: 11 Aug 2005 Posts: 17
|
Posted: Thu Aug 18, 2005 11:23 am Post subject: |
|
|
| i'm still new to PS2 programming, but can't you simply use assembly code for that patch ? (by patch i mean part of code that you need compiled differently) just write it in ASM and it should turn out ok... it's funny tho, the assembly language is the only universal language... no matter which compiler you use - it all comes to that, and even your fridge and TV and those little christmass music cards use assembly (altho embed in a single chip, but non-the-less)... isn't it cool to be a programmer or what ?:))) |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Aug 25, 2005 1:07 pm Post subject: |
|
|
| I always preferred working in assembly language myself. You always know EXACTLY what the CPU is doing. Some things require a LITTLE more work, but I think it's worth the trade off. |
|
| Back to top |
|
 |
|