LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Jim Dempsey<tapedisk@a...>
    Date: Thu May 6 15:02:15 CEST 2004
    Subject: [openrisc] inline assembly
    Top
    GCC may support the _emit directive. Also look to see if there is a predefined
    pseudo function named something like
    __emit__(arg,...)

    This is use when multiple arguments are reqired. Borland C++ used this and
    the GCC team may have borrowed this from them.

    Next I would suggest crafting #define statements that use the _emit or __emit__
    directives. Or you can use the asm (_asm) directive to output data and/or instructions.

    You must be careful verify that the GCC compiler does not assume involitility of
    registers or processor state accross your code. If your code modifies the state
    of something that the compiler thinks has not been modified then it is your
    responsibility to save and restore those items that the compiler thinks were
    not modified. Example, assume FOO is your add-on thingie.

    someVar += value;
    FOO
    otherVar += value;

    If on the first statement the compiler placed value into a register (or temporary stack location) and then assumes at the 3rd statement that the register (or temporary stack location) were not modified then if your FOO thingie modifies the register (or temporary stack location) then it is your responsibility to fix it. GCC may have a #pragma directive that performs a "forget compiler temporaries" that will force the compiler to reconstitute it's state.

    Have fun,

    Jim Dempsey


    ----- Original Message -----
    From: whli_interqos@y...
    To: openrisc@o...
    Sent: Thursday, May 06, 2004 3:49 AM
    Subject: [openrisc] inline assembly


    Hi all,
    I like to add some additional instructions to the openrisc. Then I may
    need to change the complier to generate the added the instructions.
    But It seems that very trouble. I wonder if I could use the inline
    assembly function to add the extra instructions in to the c code. And
    the complier will generate the corresponding assmbly code. Can the
    compiler do it? Thank you very much.

    Best Regards,

    Stephen
    _______________________________________________
    attachment.htm

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.