Tuesday, November 16, 2021

gnutools-gcc: dump switch

 #gcc #debugging 

details appended to fdump-rtl-pass generates messages during RTL transformations for the pass
for example:
-fdump-rtl-expand-details
produces gimple inline with its matching RTL, as well as messages on optimizations happening during expand pass.
output:

;; Generating RTL for gimple basic block 2


;; moveTo_state = 0;


(insn 10 9 0 (set (mem/c:SI (symbol_ref:SI ("|bss|moveTo_state") [flags 0x6] <var_decl 0x10382c630 moveTo_state>) [1 moveTo_state+0 S4 A32])

(const_int 0 [0])) "../library/PcCut/pccut.c":287 -1

(nil))

if some optimization doesn't react to adding details check if the pass uses TDF_DETAILS 
TDF_DETAILS is implemented in dumpfile.c


gnutools: learning resources

I have been working on GNU toolchain for about two years now.  I have worked on target ports, code upgrades, feature development and bug fixes in a target backend.

GCC has an internal document, gccint, but much of it is kept very high level.  

Developers can learn through seeing the results of an optimization, to assist a list of optimization switches and their description is provided, GCC developer-options.

In this space I intend to expand on these resources.

The information here is to augment the already in place resources highlighter above.

Tuesday, September 07, 2021

Do you expect to catch the cold and flu this year? fall - winter 2021

 Last time a cough kept me all night was 2018.  Per conversation on the social media (take it with a grain of salt --as anyone can be or do anything in the virtual world) I am not the only one who has not needed a good rest, a bowl of soup, hot tea and etc to get over a cold.

Lockdowns, masks, handwashing, they say is the reason we are getting as sick as often.  

I got my vaccines, and merely got tired a bit of a headache after both shots.

I was quite surprised when it took me three weeks to get over a cold.

I got it in early August.  It started with soar throat, and I developed a cough before I started sneezing.  Three days into it, and thick yellowish phlegm was pouring out of my nose, and mouth.  I was sleeping upright, and that only allowed for a few hours of shut eye.

It was pretty bad and pretty long.

When I told a friend that I am three weeks into a cold and I still feel under the weather, her response of 'that's strange' prompted me to look into the reason it being so drawn out.

I found a very good article online, on WebMD website on the topic.  It made a lot of sense.  To summarize: rest, stay hydrated, and manage symptoms were the key messages.

I failed in all three.

I cannot rest because I am a mom.  I was getting fluids on demand and it was by no means enough.  I was too wary of over the counter medication, e.g. Tylenol, because it is only a temp fix, and once they wear off the problems come back.

I learned, and I am documenting it here, because I have a feeling I need to remind myself these this year.  (I think there will be more germs and they will spread more this year (2021).  We are mingling more and our immune system has been out of practice for 18 months)

I learned to take the drugs soon after onset of the first symptoms, this to give my body chance to get the rest.  They say sleep boost the function of out immune system.

I learned to drink as much fluid as possible.

I also learned that gargling with salt water solution helps if done often and regularly.  

Since I am a mom, and I don't have a helping hand, I have been thinking of how could I avoid getting sick, or get the milder version of it.  These are things I have come up with:

Vitamin c intake (via food and supplement)

Vitamin D intake (sunshine and supplement

Drink a lot of water in the day and pee often (no holding! happens quite often being busy:)

Have a restful sleep - sleep on time, and don't wake up too early

Exercise, walk, yoga and pilates


That's it for now. :)

Wednesday, May 19, 2021

Preventing cancer : reducing the risks by Beliveau, Richard

I copied and pasted the below from the summary provided for the "Preventing Cancer, reducing the risks" by Beliveau, Richard


I have seen family, and friends fight the disease.  Nothing in life compares to or prepares one for it.  One day you are living as much of a normal life as possible and then cancer happens.  It puts every little aspect of one's life in a different perspective.  I don't know where I am going with all this.  Perhaps the honest truth is that I want to minimize my risk, and so here comes the next bit.  


These recommendations are from a book summary.  The books is called "Preventing cancer: reducing the risks".  It's by Richard Beliveau.  


I put them here, because I want to have them somewhere I can refer to them easily and frequently.

 

"The ten recommendations to preventing cancer are: 

1. Don't smoke. 

2. Stay as lean as possible. 

3. Limit the consumption of red meat to about one pound per week. Also helpful, marinate red meat in virgin olive oil with garlic and lemon juice or herbs like thyme or rosemary; add turmeric or related spices to ground beef. 

4. Eat a variety of fruits, vegetables, pulses (like lentils) and whole grains. Eat "superfoods" like green tea, blueberries, crucifers, garlic and tomatoes. 

5. Be physically active for at least 30 minutes every day. 

6. Limit daily alcohol consumption to two glasses for men and one for women. Better yet, drink red wine and even better, drink red pinot noir. Also, avoid mouthwash with alcohol.

 7. Limit consumption of salt. Use spices, especially Indian spices like turmeric. 

8. Avoid unnecessary sun exposure. 

9. For extra protection, vaccinate girls against HPV. Breastfeed for six months, avoid pollution and nanomaterials, get eight hours' sleep. 

10. Do not use supplements to prevent cancer." 

Thursday, May 13, 2021

Fixing network issue in VM machine running Windows 10 running in Parallels Desktop on Mac

 I have a VM setup in Parallels Desktop on my Mac.  The VM is running Windows 10 OS.  My internet connection works fine on my Mac; more expilicity I can browse the public and private domains, no problem!  


But in Windows VM, I have problems.  I am not able to get to private domains.  My VM is configured in Shared Network and I am connected to VPN on my Mac.  So, I should be able to use the VPN connection with my VM if its Network is Configured in Shared mode.  Which is, screenshot below.



However, I am not able to get to anything via the domain name.  e.g. in DOS command ping parallels.com times out.  

I can access domains via their IP but not their hostname.

Everything is pointing to DNS server not being working properly.  

On Parallels' Knowledge Base this problem is documented as: "

Unable to perform DNS requests over TCP in Shared network"

I include link to this page, as well as to all other pages on Internet that helped me debug and resolve the problem.  Unfortunately, it was not one stop shop.

I was on an older version of Parallels Desktop for Business Edition so, I 'Uninstalled' Parallels tool from  my VM, by going to Control Panel > Uninstall a Program.  After a complete reboot, I reinstalled the Parallels Tools.  Then I tried the ping command again.  Still not responding.  

I found another article: "

Network Troubleshooting your Parallels Desktop VM"


And compared the output of ipconfig /all run on my system with what was documented here.  All the information, the suggested IP, and the DNS servers matched what it is supposed to be in Shared Network configuration.

So, I decided to try the second suggestion from the first article.  "
  1. Assign DNS server manually in Windows network settings."

To do so: I did the following (which was recommendation from a colleague).  I have crossed out the DNS addresses and DNS suffixes, because this information is unique.


After doing above, my problem got resolved. 

I reinstalled the Parallels tools.  But, maybe all I needed to do, was to do the last step, that is manually assign the DNS servers. 

References:

 


Thursday, April 22, 2021

Python 2.7, its last release, its end of life, and how to transition to Python 3

 Python 2.7.18 is the last release of Python 2.

As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no longer supported.

Python 3, is not backward compatible.  python.org suggest running 2to3 tool to automatically convert Python 2 to Python 3.

Here is an example:  

The ConfigParser module has been renamed to configparser in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

ref: https://docs.python.org/2/library/configparser.html


Tuesday, March 30, 2021

Floating point number madness

 We'd like to represent floating point numbers in binary format.


The IEEE 754 format uses the 32-bit to encode a single precision floating point number as follow.


31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

|    |___Exponent________| |_____________Fraction___________________________|

Sign         



Normal: There is a one to the left of the fraction.   

                     (-1)S   x 1.x2e-127

Signed Zero:  Exponent=0 Fraction=0    

                     (-1)S  x 0

Subnormal/Denormal: Exponent=0 shifted by 1 But considering all the fraction values between 0 & 1  

                     (-1)S  x 0.f x 2-126

Infinity pos/neg Exponent=255 Fraction=0

                      (-1)S oo

NaN Exponent = 255 Fraction!=0

                       (-1)S   if b22=0 qNaN 

                                 if b22=1 sNan

b22 is bit 22nd of the Fraction 

Thursday, January 28, 2021

Vaccines, stay-at-home how to survive another year of COVID19 pandemic!

 We have been in lockdown since December 26, 2020, and an additional "stay-at-home" order since January 12, 2021.  The schools have been shut down since the break for holiday season.  


The government started administering vaccines begining December 15, 2020.  


The numbers are coming down.  In my city the average weekly new cases are in the 1500/day.


Is it due to vaccines or due to people staying-at-home?


It's more likely to be from people staying-at-home, and more specifically children staying at home.  Prior to the schools closing, there were outbreaks* at about 150+ schools in the province of Ontario.  These contributed to the increase in the transmission in the community.  


The lock-downs/stay-at-home cannot be a long term solution.  Vaccine is being rolled out at a snail pace, and it's about to get slower as companies are re-thinking distribution and countries are thinking of new policies around vaccine distribution.


Vaccines are showing some flaws.  Given the speed they were developed and approved, it doesn't surprise me that they have side-effects, and one may still get it even after being fully vaccinated*.  In addition new variants of the virus, which are more transmissible and more deadly are popping up.


When it started a year ago around this time, I admit, it threw me off balance so much that all I could care of was to be able to pass one more day without getting it.  When the numbers started going down last summer, I had a glimmer of hope that maybe the virus has taken its course and it's dying out on its own, sort of like Spanish Flu.  Things are different now.  


The measures in place, plus the new variants paint a depressing picture.  How and when can we go back to living again?


I definitely don't know the answer today.  

 

*Outbreak: 2 or more cases of COVID-19 positive within 14 days. 

*Fully vaccinated: both shots administered 

Friday, November 06, 2020

First time COVID tester

 You can find all the information on Google, as my daycare provider explained to me I need a COVID test for my daughter to be re-admitted to daycare.

Despite the fact, above is the wrong way to find any information, I had no choice but to turn to the web.  Note, web and not Google.  Most people don't distinguish that Google is not the web.  And while most information is available on-line but  the first source should be valid and verified document which should be available to those who are in the position to recommend tests, e.g. daycares in this scenario.

In any case, I had no choice but to turn to the web, and use search engines to find the answers to my questions:  where the test is performed ?  how is the test performed?  how do they admit patients for testing? 

 From conversation with the daycare provider: throat swabs for COVID-19 testing could be done at drive-thru assessment center by appointment.

What I end up doing, and it seemed to be the only option available to me, was nasal swab, at a physical location, by appointment.

It took me three hours to find the location closest to me, make an appointment online, arrive there, park, go through the process of being admitted, and get the test done.  I believe this is great, and I got extremely LUCKY.   

I started here:

COVID 19 testing locations for my area

I found out eligibility to get tests done at the pharmacy is to have no symptoms.  From there I searched for an 'Assessment Center' closest to me.  

The next step was to find out how they admit people for testing.  It was incredibly frustrating when the page would not load.  I used many different browsers on different devices to get there faster.   Slapping this information on top of a poorly designed website is wrong at many levels.

Finally, I tried a link from the not fully loaded page, that got me to appointment booking page.  This page, unlike its parent, loaded all the information quickly.  I was happy to find out the center can accommodate me in a couple of hours.  So, I booked the time slot.

We arrived at the center five minutes late.  At the entrance, I was asked if I had an appointment and since I did, I was shown in.  There was a line up at the entrance.  Which I don't know if it was for COVID testing or something else.  

The first step after entering was to give the reception my daughter's information and receive a bracelet, just as if we were being admitted to the hospital.  It was quick.

The next step was to be seen and checked for vitals, temperature, and oxygen level, and explain the symptoms.  There were six people ahead of us.  Two out of three stations were staffed.  It took us 20 minutes to be seen by the nurse.

The last step was to get the test.  We were called in almost immediately, or I guess relative to the last step it felt much faster!  A series of white plastics were hung from the ceiling to form a makeshift rooms to get the test done.  There was one chair placed in this room.  I was told to sit on the chair, and hold my baby in my lap.  I was incredibly grateful when the person performing the test appeared so quickly.  I cannot imagine how I could have kept my daughter still in such small possibly infected place.

The swab was, understandably, painful, but was quick, and the instructions I was given was really helpful to get it done fast, despite of discomfort my daughter was in.

When it was over, I waited long enough to finish his sentence about how I can access results, and just ran out of the place, all the way to the car, holding my daughter as close as possible.  

I got extremely lucky!  It could have been much worse and by that I mean it could have taken longer more dragged out, tiring.  It was not.  I thank the staff for it.

The results came the next day before noon, that's less than half a day.  Negative!



Tuesday, October 27, 2020

Learning Jenkins in an adhoc way

 It just happens that I have to setup a CI/CD ecosystem to test a series of changes to the compiler.  I am using Git and Jenkins as the framework.

I am getting to know both!

I am using corporate Jenkins, which means another team has downloaded, and configured Jenkins.  I have a personal Jenkins space, with limited configuration capabilities.  It is connected to a source repository which contains an application code, toolchain and build scripts.  The relationship between these pieces are as follow:

  the build scripts build the toolchain, which then is used to build the application code.

Each of these, the scripts, toolchain, and application, is maintained in a separate repository.  The main goal is changes to each repository triggers the build, guided by Jenkinsfile.

I added the build scripts and toolchain repositories as submodules of the application.  I then navigated through the Jenkinsfile documentation online to find a way to trigger a build when a commit was made to the git submodules.  After a couple days on the topic, I gave up.  

I tried GitSCM with various settings and none worked.

In order to make progress, I moved to an alternative way.  It is a simple minded way.  I git clone each repository, within on Jenkins Pipeline and go build the toolchain and the application in that order.

Jenkins, being so pervasive in the development world, should be able to handle multiple repositories and invoke the build when there's a change to one of them.  

Please, leave me a comment here, if you know how.  Thanks in advance!

Sunday, October 18, 2020

GNU GCC Register Transfer Expression RTX




Not a whole lot of documentation available on the topic!  I guess when you find something the hard way, you earned the right to show it off.  But, besides vanity, it's good to document it for future reference.  I can refresh my memory using this page.  It can also prove helpful to others.

Objective: gen_reg_rtx (machine_mode) vs gen_rtx_REG (machine_mode)

Declared: rtl.h

Defined: emit-rtf.c

Returns: a pseudo register/a hardware register (type rtx)

Implementation difference:   gen_reg_rtx asserts if called after compiler's register allocation phase is completed.

Code changes all the time! Above information is valid for GCC v8.3.1 source.

Saturday, May 23, 2020

Toronto Zoo Opens this weekend, May 23rd, to offer Drive-thru tours --and it's already sold out


I have not been to Toronto Zoo.  So, I am not about to ruin my first time experience by jumping into the car and going there, because I have nowhere else to go.  And when I look at the ticket prices for this "unique" experience --I am less inclined to do so!


Canada is reopening without knowing where Canadians are getting COVID-19


Canada is reopening without knowing where Canadians are getting COVID-19

is the title of this article, by Adam Miller, and published by CBC yesterday! 

He is taking advantage of two recently identified active clusters of COVID19 in Peel region, as well as London, Ontario to publish a very poorly written, very confusing article.  He sites Alberta and BC as provinces who have been 'successful' in keeping the spread of the virus under control. Then sites South Koreas' opening of night clubs as making the country taking two steps back into shutting down the night clubs!!

How the South Koreas' example is relevant to Canada not knowing where its COVID-19 cases are coming from, and how BC's, and Alberta's success (both being part of Canada) contribute to Canada's failure are questions I have when I read his article.

It's journalistic effort to grab clicks, based on the most talked about topic these days.

Really bad article!



Friday, April 17, 2020

How am I coping with the imposed quarantine?

I am full-time work-from-home compiler developer or simply a software developer.  I got this gig after 1.5 years being off, caring for my daughter.  I love it, all aspects of it.  The work, pay, and my colleagues.

I am also full-time house-wife, a very traditional kind, where most responsibilities of keeping home/life running falls on my shoulder.

I also take care of our daughter, feed, bath, and keep her social calendar filled with playdates, age appropriate classes, and activities.  I had found her a great daycare where she looks forward to going daily, and it has been so great for both of us.  I get to do my work and she gets to learn and socialize.  Of course the daycare is closed for now.

I enjoy all aspects of my life, except at times, I don't get good quality sleep and that grossly hinders my ability to cope with everything.  It's at these times, that it occurs to me I am doing more than my share.  But when this passes, it's all back to good and normal.

With quarantine I am getting very little sleep.  I am overtired, and most nights I wake up after a couple hours sleep unable to fall back asleep.  My days are not long enough, I attend to my daughter's online learning schedule, play with her, take her on walks, and only turn T.V. on when I absolutely have no other choice, like I have a 1-1 with my boss.   This is quite disruptive.  The two windows of opportunity I have to get work done, is during her nap and when she sleeps.  Both have been disrupted pretty badly.  She doesn't sleep well at night, and doesn't nap long during the day either.

I don't know for how long we are expected to stay quarantined, or more importantly how long the childcare centres will be closed for.  I google this every other day, and last I checked it was not clear when.

I don't have a plan B.  

How has the quarantine impacted my husband's life?

My husband's main concern is not to contract the virus, and he has been successful in altering and limiting his daily activities to pursue this goal.

This change is amazing, since he used to spend two hours of every three hours outside of the home every single day, without any exception.  When asked to stay home on social occasions, and other life situations, his mood would turn sour after two hours.

But now, he calmly spends his whole day at home.  Paces the small living/dining space with his phone in hand to get his 2KM daily walk everyday.  Eats his breakfast and lunch at home, something that probably happened less than the count of my fingers over the course of 8 years marriage.  Get his work done remotely, and watches T.V. with our daughter.  

He rarely helps out with the work around the house, that has not been his thing, and he is not about to change now that he's at home all the time to see the amount of work that goes on daily to keep the house and life in general running.

He can continue with this lifestyle until it's declared safe to go out.

Thursday, April 16, 2020

How is this quarantine changing the way my toddler perceives the world?

To her, with limited vocabulary, certain things such as school, supermarket, library, parks, are "broken".

I am trying my best to convince her, it's "broken", but not for good, and not only for her.

She gets excited to meet her friends virtually but half way through the meet up she tears up, and starts shaking her head, that she no longer wants to continue with this.  These days she can spent hours with the animated characters, she knows their names, and happily references them in her conversation.  Reminding her of the names of her real life friends have the reverse effect on her mood.

I am trying my best to convince her, no matter what the situation, we need to keep in touch with our real friends, even if they aren't physically close to us.

The idea of fresh air, and spending time outdoors appeals to her, but when we are out, with careful planning ahead, and much caution, it only takes 10 minutes for her to ask to go home.

While our governments' effort in taking slow, and calculated steps to reopen our economy is much appreciated, kids and their re-integration in the normal cycle of life should be discussed too.

Saturday, March 30, 2019

Things We Left Unsaid

I read this book in translation.  As a native of the country the author is from, I found the translation fell short at times.
I liked the story.  Clarice, the protagonist, is a full time mom and housewife.  She has three children, the twins Arsineh, Armineh, and her son Armen.  Her husband, Artoush, is a man with strong political convictions, something Clarice openly objects.  Her mother is a perfectionist, and she is not shy in pointing out to Clarice her shortcomings in being a housewife.  Her sister, Alice, is her complete opposite.  She thinks highly of herself, has too much self confidence,  and has an opinion about anyone and anything (more often unfavorable).
The story is almost insignificant; recounts the daily lives of Clarice's family, and her social interactions with friends and neighbor.  Through out these insignificant events we meet the new neighbors, Emile, a widower, his daughter, Emily, and his mother.   They add an element of enigma to the story of Clarice's life.  Clarice interacts with them, almost reluctantly, and only because others wants her to do so.   Ironically, this forced relationship opens Clarice up to a whole new level of self awareness.  She questions her current status and wonders about the choices she has made in life.
I could empathize with Clarice.  I too often find myself putting everyone else's needs ahead of mine.  But, I hoped the story offered a shift, but instead, I think, it offered a middle ground, where Clarice was still the same person, doing the same things, but now, recognized [instead of taken for granted].

All My Puny Sorrows

This is one incredible story of strength of a family supporting, and loving each other through the toughest times. It may not be even a story, as I have heard that there's an autobiographical element to it. It is told from the perspective of the younger sister, Yolanda. 
Yolanda, the narrator, is an aspiring author. She has married twice, and about to divorce out of her second marriage. She has two children from each of her marriages. She has moved to Toronto to enable her daughter to follow her dream of becoming a dancer. She is originally from Edmonton, where her mother, and sister still live. 
Multiple unsuccessful suicide attempts of Yolanda's sister, Elfrieda, brings her back to her hometown. And why would Elfrieda want to take her own life? She has everything going for her; an established pianist who has reached fame and fortune very early in her career, and a married woman; her husband's life revolves around her.
This book is not going to answer your burning question about mental health. It is also not going to provide [false] hope that the system in place is efficient, and well equipped to care for patients in this category. But, it is going to tell you an honest story one family's courageous [futile] fight to keep their loved one safe. 
I loved reading this book, but it left the desire of hearing Elfrieda's voice unanswered. I wish the author would had disclosed more of Elfrieda's emotions in this story.

Thursday, December 13, 2018

When Breath Becomes air, by Paul Kalanithi

Talking about death or dying are avoided on the account of being sad topics. Or perhaps we avoid it because we don't know much about it. I wonder if we thought and spoke about it more openly, pragmatically it would lead us to live a happier, more meaningful life.
In “When Breath Becomes Air” Paul Kalanithi attempts to find the meaning of life through understanding death. I like to think he would have written this book, much later in his life. That's what he talks about in his opening chapter. That pursuit of meaning of life and learning about death was his life quest, that he thought studying literature was where he finds the answer but then he realized being a doctor may lead to a better understanding of life and death. His story is sprinkled with irony, as he writes about his life as a doctor and as a patient. He doesn't approve of using stats as a doctor to tell patients something like, "you have six more months to live."; yet he is curious about the number of months left of his own life when talking to his oncologist. 
So, did I learn more about death after I turned the last page of this book, I certainly did not. But, what this book taught me was it's good to stay curious about it, even in perfect health.

Monday, May 14, 2018

All the Ugly and Wonderful Things, Bryn Greenwood

Bryn Greenwood has crafted a very complicated, and interesting character, Wavonna Quinn. Greenwood has also developed supporting characters whose behaviors and actions define Wavonna. A drug dealer father and drug user mother are very unfortunate role models and caregivers. Despite the parents abusive and neglecting behavior Wavonna grows up, finding ways to survive and care for her baby brother, Donal. 

In the eye of those who meet Wavonna she is a girl who doesn't talk and eat. But behind this facade there's a person with depth, kindness, and intelligence. 


Greenwood is thorough, and consistent, the result is: a story that is believable.

Many reviews of the book glorify it as a "love story". This is true. 
It is a love story of two outcasts, Wavy and Kellen, who could not be any more different in social and cultural status. These two are different, yet deeply care for each other so much that they are prepared to let go of each other for the sake of "well-being" of the other. 

Greenwood, however, chooses to end their love story on a happy note and she does it pragmatically.

Along the way, there are people whose wrong judgement make Wavy's and Kellen's, and consequently little Donal's life very difficult, (grinding teeth, and knot in the stomach chapters). But they are proven wrong (Yay!). 

It has been a few weeks since I finished reading, but I still think about it. 

Quotes that really made the book stand out for me are:

Wavy: "Nothing belongs to you"
Wavy: "I am as real as you are. My family is real like your family."

I really liked this book!  The only dilemma I have is Wavy being a minor when the two became intimate. Why has Greenwood made this choice is beyond me.