RFC: A new psABI for Intel MCU

578 views
Skip to first unread message

H.J. Lu

unread,
May 11, 2015, 9:43:26 AM5/11/15
to IA32 System V Application Binary Interface
I am working on a new psABI for Intel MCU with requirements:

• Support IA32 without FPU.
• Minimum ISA: Pentium ISA without x87 FPU instructions.
• Don't allow mixing i386 object files with Intel MCU object files.
• Support floating point with software emulation:
a. Long double is the same as double.
b. Use __float80 for 80-bit double.
• Minimize memory footprint:
a. Code size
b. Data size
c. Stack size

Here is the draft of Intel MCU psABI. The differences from IA32
psABI are

1. The minimum instruction set is Intel Pentium ISA minus instructions
for x87 floating point unit.
2. There are no x87 floating point registers.
3. There are no vector registers.
4. Segment registers are optional.
5. Support for TLS relocations are optional.
6. Scalar types larger than 4 bytes are aligned to 4 bytes.
7. There are no vector types.
8. _Decimal32, _Decimal64, and _Decimal128 types are optional.
9. long double type is the same as double.
10. float, double and long double types are passed and returned in
general purpose registers.
11. _Decimal32 and _Decimal64 types are passed in general purpose
registers.
12. Aggregate types no larger than 8 bytes are passed and returned
in general purpose registers.
13. Stack is 4-byte aligned.
14. The auxiliary vector support is optional.
15. Register %edx has undefined value at process entry.
16. New ELF machine code: EM_IAMCU.
17. New predefined C/C++ pre-processor symbols: __iamcu and __iamcu__

The PDF file is available at

https://sites.google.com/site/x32abi/documents/iamcu-abi-0.6.pdf?attredirects=0&d=1

and its source is on hjl/mcu/master branch at

https://github.com/hjl-tools/x86-psABIhttps://github.com/hjl-tools/x86-psABI

Any comments, feedbacks and suggestions are appreciated.


--
H.J.

H.J. Lu

unread,
Jul 3, 2015, 11:08:04 AM7/3/15
to IA32 System V Application Binary Interface
Since the implicit pointer argument for returning values in memory is
passed in %eax, there is no implicit pointer argument on the stack.
I updated IA MCU psABI to version 0.7 and uploaded the PDF file to

https://github.com/hjl-tools/x86-psABI/wiki/iamcu-psABI-0.7.pdf

--
H.J.
Reply all
Reply to author
Forward
0 new messages