This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: R: General information on Hitachi SH math performance
Giulix wrote:
>
> > The second path is to completely override the math functions in
> assembler.
> > Currently, for libc, routines may be overridden by placing assembler
> versions
> > in the appropriate machine directory (e.g. libc/machine/i386). The name
> of the
> > object file must be the same as the generic C version (e.g. strcpy.o).
>
> If I look for "strcpy" there is a file in libc/machine/sh and one in
> libc/string as mentioned by you. But if I look at "divhi3" there is only one
> in machine/h8500 and not one in libc. Why ?
>
This function is not a C library function.
> There are difference around sh series hitachi microprocessor. For example
> SH1 have no dword mac. SH2 have dword mac. SH4 have hardware fp. I see that
> libc/machine/sh files must support all the SH series. I can't test all
> platform because I have only SH2 7045F model :-( Any suggestion ?
>
In cases like that, you should make the appropriate changes and then post
the patch for review, noting that you only have tested it on platform X.
> I have tryed to compile this simple function with gcc-2.95.2 for SH:
>
> int qem_main()
> {
> volatile long a,b,c,d,e,f;
> b = a/b;
>
> return 0;
> }
>
> I see in dissasembler file thar the compiler use the "___sdivsi3" function.
> Where this funtion is ? Is buided into compiler or is part of newlib ?
>
So it is actually the math operators that you are having problems with. The
suggestions I made earlier were with regards to the math functions in the
C library. The math operators are built by the compiler and are not part of newlib.
You should post your performance concerns to the gcc forum.
-- Jeff J.