This is an archive of the discontinued LLVM Phabricator instance.

[UpdateTestChecks] Fix PowerPC RE to support AIX assembly
ClosedPublic

Authored by qiucf on Dec 22 2020, 1:38 AM.

Details

Summary

Current update_llc_test_checks.py cannot generate checks for AIX (powerpc64-ibm-aix-xcoff) properly. Assembly generated is little bit different from Linux:

AIX:

	.align	2                               # -- Begin function powf_f32_fast025
L..CPI0_0:
	.vbyte	4, 0x3e800000                   # float 0.25
	.csect .text[PR],2
	.globl	powf_f32_fast025[DS]
	.globl	.powf_f32_fast025
	.align	2
	.csect powf_f32_fast025[DS],3
	.vbyte	8, .powf_f32_fast025            # @powf_f32_fast025
	.vbyte	8, TOC[TC0]
	.vbyte	8, 0
	.csect .text[PR],2
.powf_f32_fast025:
# %bb.0:                                # %entry
	mflr 0
	std 0, 16(1)
	stdu 1, -112(1)
	ld 3, L..C0(2)
	lfs 2, 0(3)
	bl .powf[PR]
	nop
	addi 1, 1, 112
	ld 0, 16(1)
	mtlr 0
	blr
L..powf_f32_fast0250:
	.vbyte	4, 0x00000000                   # Traceback table begin
	.byte	0x00                            # Version = 0
	.byte	0x09                            # Language = CPlusPlus
	.byte	0x22                            # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
                                        # +HasTraceBackTableOffset, -IsInternalProcedure
                                        # -HasControlledStorage, -IsTOCless
                                        # +IsFloatingPointPresent
                                        # -IsFloatingPointOperationLogOrAbortEnabled
	.byte	0x41                            # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
                                        # OnConditionDirective = 0, -IsCRSaved, +IsLRSaved
	.byte	0x80                            # +IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0
	.byte	0x00                            # -HasVectorInfo, -HasExtensionTable, NumOfGPRsSaved = 0
	.byte	0x00                            # NumberOfFixedParms = 0
	.byte	0x03                            # NumberOfFPParms = 1, +HasParmsOnStack
	.vbyte	4, 0x80000000                   # Parameter type = f
	.vbyte	4, L..powf_f32_fast0250-.powf_f32_fast025 # Function size
	.vbyte	2, 0x0010                       # Function name len = 16
	.byte	'p,'o,'w,'f,'_,'f,'3,'2,'_,'f,'a,'s,'t,'0,'2,'5 # Function Name
                                        # -- End function

Linux:

	.p2align	2                               # -- Begin function powf_f32_fast025
.LCPI0_0:
	.long	0x3e800000                      # float 0.25
	.text
	.globl	powf_f32_fast025
	.p2align	2
	.type	powf_f32_fast025,@function
	.section	.opd,"aw",@progbits
powf_f32_fast025:                       # @powf_f32_fast025
	.p2align	3
	.quad	.Lfunc_begin0
	.quad	.TOC.@tocbase
	.quad	0
	.text
.Lfunc_begin0:
	.cfi_startproc
# %bb.0:                                # %entry
	mflr 0
	std 0, 16(1)
	stdu 1, -112(1)
	.cfi_def_cfa_offset 112
	.cfi_offset lr, 16
	addis 3, 2, .LCPI0_0@toc@ha
	lfs 2, .LCPI0_0@toc@l(3)
	bl powf
	nop
	addi 1, 1, 112
	ld 0, 16(1)
	mtlr 0
	blr
	.long	0
	.quad	0
.Lfunc_end0:
	.size	powf_f32_fast025, .Lfunc_end0-.Lfunc_begin0
	.cfi_endproc
                                        # -- End function

This patch will fix that.

Diff Detail

Event Timeline

qiucf created this revision.Dec 22 2020, 1:38 AM
qiucf requested review of this revision.Dec 22 2020, 1:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2020, 1:38 AM

Please add a test under test/tools/UpdateTestChecks/update_llc_test_checks/

Yes, test is missing as MaskRay mentioned. You'd better update one PowerPC test at least so that, we can see what it looks like.

qiucf updated this revision to Diff 314064.Dec 29 2020, 9:42 PM

Update with tests

MaskRay accepted this revision.Dec 30 2020, 9:29 AM

Looks great!

This revision is now accepted and ready to land.Dec 30 2020, 9:29 AM
steven.zhang accepted this revision.Dec 30 2020, 5:18 PM

Also LGTM.

This revision was automatically updated to reflect the committed changes.