Skip to content
Snippets Groups Projects
Commit 7c2c7dd2 authored by Takayuki 'January June' Suwa's avatar Takayuki 'January June' Suwa Committed by Max Filippov
Browse files

xtensa: Recover constant synthesis for HImode after LRA transition

After LRA transition, HImode constants that don't fit into signed 12 bits
are no longer subject to constant synthesis:

    /* example */
    void test(void) {
      short foo = 32767;
      __asm__ ("" :: "r"(foo));
    }

    ;; before
    	.literal_position
    	.literal .LC0, 32767
    test:
    	l32r	a9, .LC0
    	ret.n

This patch fixes that:

    ;; after
    test:
    	movi.n	a9, -1
    	extui	a9, a9, 17, 15
    	ret.n

gcc/ChangeLog:

	* config/xtensa/xtensa.md (SHI): New mode iterator.
	(2 split patterns related to constsynth):
	Change to also accept HImode operands.
parent 777df37a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment