Hi Tejas, On Thu, Jun 13 2019, Tejas Joshi wrote: > Hello. > As further part of implementing roundeven is inlining, I was studying > machine descriptions and I have a few questions. > > As suggested, builtin functions provided a strong model for > implementing roundeven. Keeping that in mind, I tried to inspect how > similar functions (round/ceil) would get inlined. As it is dependent > on target machine, (mine is i7, so should be x86_64 ? I wonder why > gcc/config/ does not have x86_64 or amd64 directory. Or is it i386 > itself as extended?),
Yes, the directory with x86_64 specific stuff is i386. > should *.s file after compilation contain the > specific instruction if supported? I was unable to see such kind of > instruction on any -O level. > I am not sure I understand your question. Yes, the intent is that when the compiler cannot determine the argument of roundeven to be constant, it should emit the instruction instead of a library call, if the target architecture supports it. (and if IIUC, the intent is to use the 0 mode from table 4-8 in https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf in instructions that take a rounding a mode to implement roundeven). Of course the instruction is not present there, that is the next step in your project :-) > Different pattern names are available for machine descriptions > <https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html>, also for > round, ceil, etc. Will I have to add such pattern name for roundeven? > (is it the same as optab defined in optabs.def?) Yes. Martin