[PATCH] Do not generate Tag_DIV_use=AllowDIVExt when hardware div is non-optional

Artyom Skrobov Artyom.Skrobov at arm.com
Fri Jan 17 09:41:13 PST 2014


Hello,

ARMAsmPrinter::emitAttributes emits AllowDIVExt (2) for Tag_DIV_use whenever
the compilation target has hardware divide in both ARM and Thumb instruction
sets.
According to the ABI, this is incorrect:

2: This code was permitted to use SDIV and UDIV in the ARM and Thumb ISAs;
the instructions are present as an optional architectural extension above
the base architecture implied by Tag_CPU_arch and Tag_CPU_arch_profile.
Note: Producers must emit value 2 if and only if the permission to use SDIV
and UDIV cannot be conveyed using values 0 and 1.

In ARMv8, hardware divide is mandatory in both ARM and Thumb instruction
sets, and therefore, Tag_DIV_use should not be emitted, as the default value
AllowDIVIfExists (0) is sufficient to express the permission to use hardware
divide.

OK to commit?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-AllowDIVExt.patch
Type: application/octet-stream
Size: 6083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140117/24dfd867/attachment.obj>


More information about the llvm-commits mailing list