1 / 20

Quantitative approach to ISA design and compilation for code size reduction

SimpLight Nanoelectronics Ltd Kevin Lo, Lin Ma. Quantitative approach to ISA design and compilation for code size reduction. Outline. Introduction Problem definition Existing approach Our approach Hardware support compiler support Experimental Results Summary. Introduction.

louanna
Télécharger la présentation

Quantitative approach to ISA design and compilation for code size reduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SimpLight Nanoelectronics Ltd Kevin Lo, Lin Ma Quantitative approach to ISA design and compilation for code size reduction

  2. SimpLight Confidential Outline • Introduction • Problem definition • Existing approach • Our approach • Hardware support • compiler support • Experimental Results • Summary

  3. SimpLight Confidential Introduction • Code Size is a critical issue for Embedded Applications. • Mixed size Instruction Set is commonly used • Normal length instruction set • Compressed length instruction set

  4. SimpLight Confidential Problem definition • Trade off between • Maximum code size compression ratio. • Least degradation in performance. • Implementation cost

  5. Existing approach SimpLight Confidential

  6. SimpLight Confidential Instruction Analysis • Real applications • Uclibc: Open source c-library package for embedded applications • 729a: Voice codec program used in mobile phones • Mpeg4: MPEG-4/ASP decoder program • Nucleus: RTOS for embedded processors (ported to the Mips-like architecture) • Libmad: MPEG audio decoder library • Uclinux: Linux kernel release 2.6.xx for embedded processors • Lay2/3: Layer 2 and Layer 3 of the GSM wireless communication protocol stack

  7. No Operands 6-bit Index26 6-bit 26-bit 2 GPRs 6-bit 5-bit 5-bit 3 GPRs 6-bit 5-bit 5-bit 5-bit 6-bit 5-bit 5-bit 16-bit immediate 2 GPRs + imm16 2 GPRs + imm5 6-bit 5-bit 5-bit imm5 Instruction Analysis 32-bit instruction format SimpLight Confidential

  8. No Operands 6-bit 2 GPRs 6-bit 5-bit 5-bit 3% use 16-bit or less 16-bit instruction format SimpLight Confidential

  9. 3 GPRs 6-bit 5-bit 5-bit 5-bit 2 GPRs + imm5 6-bit 5-bit 5-bit imm5 8% result == one operand 16-bit instruction format SimpLight Confidential

  10. 3 GPRs 6-bit 5-bit 5-bit 5-bit 6-bit 5-bit 5-bit imm5 20.9% use $0 16-bit instruction format 2 GPRs + imm5 SimpLight Confidential

  11. 6-bit 5-bit 5-bit 16-bit immediate 2 GPRs + imm16 21.3% use stack pointer 16-bit instruction format SimpLight Confidential

  12. 6-bit 5-bit 5-bit 16-bit immediate 2 GPRs + imm16 6-bit 5-bit 5-bit imm5 4.4% use immediate 0 16-bit instruction format 2 GPRs + imm5 SimpLight Confidential

  13. imm5 No Operands 6-bit 2 GPRs 6-bit 5-bit 5-bit 3 GPRs 6-bit 5-bit 5-bit 5-bit 6-bit 5-bit 5-bit 16-bit immediate 2 GPRs + imm16 2 GPRs + imm5 6-bit 5-bit 5-bit imm5 Total 47.47% could only use 16-bit 16-bit instruction format Maximum 24% code size reduction ratio SimpLight Confidential

  14. SimpLight Confidential Hardware support • Decoding phase-instruction fetching handler • For word aligned 16-bit instruction: same as 32-bit • For half-word aligned 16-bit instruction: shift to form a word alignment 32-bit

  15. SimpLight Confidential Instruction Selection - tag Register Allocation Instruction replacement Code Emitting Scheduling for code size Compiler support Normal Instruction Set Analyze OP to tag candidates Schedule for max paired 16-bit OPs Mixed instruction Assembly

  16. SimpLight Confidential Scheduling for code size • Object • Get more paired 16-bit OPs • Heuristic for code size purpose • At step t, data ready instructions in a priority list { OP16_1t, OP32_2t… }, OP16_1t is a best candidate if satisfies: • OP16_it is the only candidate • More than One 16-bit instructions in the priority list • At step t-1, an unpairedOP16_jt-1was issued. • use original scheduling policy to loop body BB to minimize performance degradation

  17. SimpLight Confidential perf size perf & size Experiments result • Code size compression ratio • About 17%-23% Scheduling policy perf: original size: code size to all BBs perf&size: code size to non loop body BBs

  18. Experiments result • Performance • slight improvement to performance from 0.6% to 4.6% SimpLight Confidential

  19. Summary • A simple but effective approach to implement code size reduction • Focus on instruction analysis with real applications • Using all registers • Scheduling policy for code size purpose • Little cost in hardware • About 17%-23% compression ratio and slight improvement to performance from 0.6% to 4.6% SimpLight Confidential

  20. SimpLight Confidential Thank you !

More Related