Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Kuznetsov Artyom lab 3 (option 1) #103

Merged

Conversation

Kuznetsov-Artyom
Copy link

@Kuznetsov-Artyom Kuznetsov-Artyom commented Apr 21, 2024

implemented a plugin that combines two instructions (mul/add) into one muladd

Example:

// test.cpp
__m128d muladd_test2(__m128d a, __m128d b, __m128d c) {
  __m128d tmp = a * b;
  tmp = tmp + c;
  return tmp;
}
; test.ll
  define dso_local noundef <2 x double> @_Z12muladd_test2Dv2_dS_S_(<2 x double> noundef %a, <2 x double> noundef %b, <2 x double> noundef %c) local_unnamed_addr #2 {
  entry:
    %mul = fmul <2 x double> %a, %b
    %add = fadd <2 x double> %mul, %c
    ret <2 x double> %add
  }
# test_input.mir
  bb.0.entry:
    liveins: $xmm0, $xmm1, $xmm2
  
    renamable $xmm0 = nofpexcept MULPDrr killed renamable $xmm0, killed renamable $xmm1, implicit $mxcsr
    renamable $xmm0 = nofpexcept ADDPDrr killed renamable $xmm0, killed renamable $xmm2, implicit $mxcsr
    RET64 $xmm0
# test_outut.mir
iveins: $xmm0, $xmm1, $xmm2
  
    $xmm0 = VFMADD213PDZ128r $xmm0, $xmm1, $xmm2, implicit $mxcsr
    RET64 $xmm0

@Kuznetsov-Artyom Kuznetsov-Artyom requested a review from m-ly4 April 23, 2024 02:23
@Kuznetsov-Artyom Kuznetsov-Artyom requested a review from m-ly4 April 24, 2024 16:00
Co-authored-by: m-ly4 <mikelitch@gmail.com>
@Kuznetsov-Artyom Kuznetsov-Artyom requested a review from m-ly4 April 25, 2024 19:18
@m-ly4 m-ly4 merged commit cfb90b2 into NN-complr-tech:course-spring-2024 Apr 25, 2024
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants