This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [2/2] divmod transform: override expand_divmod_libfunc for ARM and add test-cases

On 28 July 2016 at 20:14, Ramana Radhakrishnan
<> wrote:
>> appear UNSUPPORTED.
>> That's because this config appears to define
>> __ARM_ARCH_EXT_IDIV__ however idiv appears not to be present.
>> For instance __aeabi_div is called to perform
>> division for the following test-case:
>> int f(int x, int y)
>> {
>>   int r = x / y;
>>   return r;
>> }
>> Compiling with -O2:
>> f:
>> @ args = 0, pretend = 0, frame = 0
>> @ frame_needed = 0, uses_anonymous_args = 0
>> push    {r4, lr}
>> bl      __aeabi_idiv
>> pop     {r4, pc}
>> I assumed if __ARM_ARCH_EXT_IDIV was defined, then
>> there should have been idiv instead of call to __aeabi_div
>> or am I missing something ?
>> Um I had configured with --with-tune=cortex-a9. Is that incorrect for
>> armv8l-unknown-linux-gnueabihf ?
> --with-tune shouldn't make a difference to code generation settings. The code generation you are showing is certainly odd for this testcase  - and not something I can reproduce on pristine trunk - so sounds like something's broken by your patch . You should be seeing an sdiv in this case in the output - Look at the .arch directive at the top of your file - maybe that gives you a clue in terms of making sure that you had configured the toolchain correctly.
There is no .arch in the assembly however there's .cpu arm10dtmi at
the top, full assembly:
With pristine trunk (r238800), I still get __aeabi_idiv for the above test-case.
config opts: --enable-languages=c,c++ --target=armv8l-linux-gnueabihf
--with-arch=armv8-a --with-fpu=neon-fp-armv8 --with-float=hard
--with-mode=thumb --enable-multiarch --disable-multilib
Tried with native stage-1 build and cross build.
I verified that __ARM_ARCH_EXT_IDIV__ is defined, with following
test-case, which fails to compile.
#ifdef __ARM_ARCH_EXT_IDIV__
#error "has div insn"
int x;

> regards
> Ramana
>> xgcc -v:
>> Using built-in specs.
>> COLLECT_GCC=armhf-bootstrap-build/gcc/xgcc
>> Target: armv8l-unknown-linux-gnueabihf
>> Configured with: ../gcc/configure --enable-languages=c,c++,fortran
>> --with-arch=armv8-a --with-fpu=neon-fp-armv8 --with-float=hard
>> --with-mode=thumb --enable-multiarch --with-tune=cortex-a9
>> --disable-multilib
>> Thread model: posix
>> gcc version 7.0.0 20160727 (experimental) (GCC)
>> Thanks,
>> Prathamesh
>>> Thanks,
>>> Ramana

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]