Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase hifi3 patches on 17.0.1 #88

Conversation

gerekon
Copy link
Collaborator

@gerekon gerekon commented Jan 9, 2024

Rebase patches from #85 onto 17.0.1 branch

@gerekon
Copy link
Collaborator Author

gerekon commented Jan 9, 2024

@maciej-czekaj Could you kindly check rebased patches? After rebasing I faced several build errors due to API changes. The fixes for them are in several last commits like tmp: Fix ....

DROPME: ... commits can be ignored they were picked from #87 and added just to run build/test pipelines for this PR.

@gerekon
Copy link
Collaborator Author

gerekon commented Jan 9, 2024

Looks like 2 clang tests fail

  1. xtensa-xtbool-intrinsics.c due to -no-opaque-pointers option. I will fix this.
  2. xtensa-abi.c boolean feature test fails. Need to investigate

@maciej-czekaj
Copy link

@gerekon Thanks for the heads up! I will fix it.

@maciej-czekaj
Copy link

@gerekon I have pushed 2 fixes in #89

  • e89f8ed [Xtensa] Fix reg scavenging in XtensaRegisterInfo
  • 3dc2319 [Xtensa] Fix LLVM argument size for bool vectors.

@gerekon
Copy link
Collaborator Author

gerekon commented Jan 17, 2024

Close in favor of #89

@gerekon gerekon closed this Jan 17, 2024
@gerekon gerekon reopened this Jan 23, 2024
Xtensa S3 DSP instructions are coded using explicit register allocation.
However, some instructions miss RegState:Define flag for output
registers. This leads MachineVerifier to raise errors.
This commit adds missing definitions.
Boolean Extension support consists of:
- v1i1 boolean vector type backed by BR boolean register class
- calling convection for boolean variables
- boolean instructions implementing logical operators
- truncation and zero-extension operations for conversion to scalars
- register spill and fill logic
loadImmediate is split into two functions:
- buildLoadImmediate which accepts allocated registers as params
- loadImmediate which allocates virtual registers

buildLoadImmediate is inteded to be used in post-RA passes.
BRegFixupPass implements post-RA transformations for boolean
instructions:
 - selecting the right constant for SLLI shift instruction based on
   physical register number. The number is unknown before regster
   allocation.
 - selecting the right constant for EXTUI bit extract operation based on
   physical BR register
 - emulating MOVBA (reg copy from AR to BR) operation
LLVM bitcode tests verify that Xtensa backend can:
 - convert between v1i1 and scalar
 - generate code for v1i1 vselect
 - spill & restore BR registers
 - load and store v1i1 values
Prepare a separate directory for Xtensa-specific Clang CodeGen tests.
Extend Xtensa C ABI test to include v1i1 parameters.
Adding __builtin_xtensa_movt_s and __builtin_xtensa_movf_s intrinsics.
Adding intrincic patterns to   MOVT_S anf MOVF_S definitions.
This patch adds a definition of Xtensa LX6 CPU variant present in Intel
Cannonlake and Tigerlake SOC platforms.
Some Xtensa targets may still use GAS as a default assemblwr through
-fno-integrated-as option. These changes make the assembly output
compatible with GAS by default.
  - GAS does not recognize .word but .2byte works for both
  - Dwarf CFI is not supported by GAS. Option -fdwarf-exceptions can
    still turn it on but there is no option to turn it off, so an
    opt-in approach is more portable.
Xtensa architecture uses v2i1 (BR2 reg class) and v4i1 (BR4 reg class) boolean vectors as arguments for HIFI instructions:
 - vector compare, e.g.: AE_EQ16X4
 - vector conditional move, e.g: AE_MOVT16X4
maciej-czekaj and others added 14 commits January 23, 2024 21:19
This option is passed to GNU AS and makes Xtensa compiler driver
compatible with GCC.
Intrinsics: __builtin_xtensa_ae_int32x2 and builtin_xtensa_int32
are convenience functions for easy integer-vector and vector-vector
conversions that conform to Xtensa coding style.
Xtensa C dialect allows for implicit conversion between wider and
narrower vector (via shuffle) and between integer and any vector (via
broadcast). Standard Clang vectors do not support this, so these
functions provide a handicap for better portability.
@gerekon gerekon force-pushed the rebase_hifi3_patches_on_17.0.1 branch from e3f239d to 484c133 Compare January 23, 2024 18:26
@gerekon
Copy link
Collaborator Author

gerekon commented Jan 24, 2024

merged

@gerekon gerekon closed this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants